Skip to content

Commit

Permalink
Revert "Use pytest runner instead of custom code"
Browse files Browse the repository at this point in the history
This reverts commit 1d50f71.
  • Loading branch information
mlenzen committed Jun 30, 2018
1 parent 1d50f71 commit 14c7211
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -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 pytest
script: coverage run --source collections_extended setup.py test

after_success: coveralls
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -29,7 +29,7 @@ lint:
flake8 --statistics --count

coverage:
coverage run --source collections_extended setup.py pytest
coverage run --source collections_extended setup.py test
coverage report -m
coverage html

Expand Down
20 changes: 19 additions & 1 deletion setup.py
@@ -1,7 +1,25 @@
"""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(
Expand Down Expand Up @@ -46,7 +64,7 @@
],
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 14c7211

Please sign in to comment.