From 630afa4926815d06d0f46ebfa2b6bd7bd3f964d1 Mon Sep 17 00:00:00 2001 From: Ruben Verweij Date: Fri, 17 Feb 2017 11:39:41 +0100 Subject: [PATCH] Add code coverage info --- .travis.yml | 6 +++++- test.py | 11 ++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c60fadb..e8e036c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,4 +18,8 @@ python: - "nightly" # currently points to 3.7-dev install: "pip install -r requirements.txt" -script: python ./test.py \ No newline at end of file +script: python ./test.py + +after_sucess: + - pip install codeclimate-test-reporter coverage + - CODECLIMATE_REPO_TOKEN=8582900c285e4da0f253555b1bac1ba501bd6ff07850b0f227166b3cdac59ecc codeclimate-test-reporter \ No newline at end of file diff --git a/test.py b/test.py index 05aa018..e5a6d6c 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,6 @@ -import unittest -loader = unittest.TestLoader() -tests = loader.discover('tests', pattern='test_*.py', top_level_dir='.') -testRunner = unittest.TextTestRunner() -testRunner.run(tests) +import nose +from os import path + +file_path = path.abspath(__file__) +tests_path = path.join(path.abspath(path.dirname(file_path)), "tests") +nose.main(argv=[path.abspath(__file__), "--with-coverage", "--cover-erase", "--cover-package=nd2reader", tests_path])