Skip to content

Commit

Permalink
Add test coverage data with coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Apr 24, 2014
1 parent 8458c35 commit 4f58186
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ python:
install:
- "pip install -r requirements.txt --allow-all-external"
- "pip install -e ."
- "pip install coveralls"
# command to run tests
script: make test
script:
coverage run --source=idxtools setup.py test
after_success:
coveralls
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,22 @@
use_setuptools()
from setuptools import setup, Extension

from setuptools.command.test import test as TestCommand
import sys
import indexfile

class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['test']
self.test_suite = True

def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)

setup(
name=indexfile.__name__,
version=indexfile.__version__,
Expand Down Expand Up @@ -37,4 +51,6 @@
'%s = indexfile.cli.indexfile_main:main' % indexfile.__name__,
]
},
tests_require=['pytest'],
cmdclass = {'test': PyTest},
)

0 comments on commit 4f58186

Please sign in to comment.