Permalink
Browse files

Use pytest runner instead of custom code

  • Loading branch information...
mlenzen committed Jun 30, 2018
1 parent bb67394 commit 1d50f719c799fade66ffce91a69bd0616522b614
Showing with 3 additions and 21 deletions.
  1. +1 −1 .travis.yml
  2. +1 −1 Makefile
  3. +1 −19 setup.py
@@ -19,6 +19,6 @@ install:
- pip install coveralls
# command to run tests, e.g. python setup.py test
script: coverage run --source collections_extended setup.py test
script: coverage run --source collections_extended setup.py pytest
after_success: coveralls
@@ -29,7 +29,7 @@ lint:
flake8 --statistics --count
coverage:
coverage run --source collections_extended setup.py test
coverage run --source collections_extended setup.py pytest
coverage report -m
coverage html
@@ -1,25 +1,7 @@
"""setup.py for collections_extended."""
from os.path import dirname, join
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
"""TestCommand to run py.test."""
def finalize_options(self):
"""Finalize option before test is run."""
TestCommand.finalize_options(self)
self.test_args = ['tests']
self.test_suite = True
def run_tests(self):
"""Run tests."""
import pytest
errcode = pytest.main(self.test_args)
sys.exit(errcode)
setup(
@@ -64,7 +46,7 @@ def run_tests(self):
],
long_description=open(join(dirname(__file__), 'README.rst')).read(),
install_requires=['setuptools'],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
package_data={'': ['README.rst', 'LICENSE', 'CONTRIBUTING.rst']},
cmdclass={'test': PyTest},
)

0 comments on commit 1d50f71

Please sign in to comment.