diff options
author | Chris Dent <chris.dent@gmail.com> | 2018-11-22 19:11:32 +0000 |
---|---|---|
committer | Chris Dent <chris.dent@gmail.com> | 2018-11-22 19:11:32 +0000 |
commit | 3082f349f2fe110bb6d5400e9caebbc29abc8bfe (patch) | |
tree | 326b045df162b1d508ba8cde17c257228276da48 | |
parent | ff81a47051c40a3998b0844ee130ec67e01a0b4b (diff) | |
download | pastedeploy-git-3082f349f2fe110bb6d5400e9caebbc29abc8bfe.tar.gz |
Make 'python setup.py test' work
Packagers sometimes like to use 'python setup.py test'. This
change adjusts setup.py and setup.cfg to allow this to work
with pytest instead of nose. To make things work, the
settings for coverage need to be moved into tox.ini.
A SkipTest in test_config_middleware is changed to its pytest
equivalent.
-rw-r--r-- | pytest.ini | 1 | ||||
-rw-r--r-- | setup.cfg | 3 | ||||
-rw-r--r-- | setup.py | 4 | ||||
-rw-r--r-- | tests/test_config_middleware.py | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
5 files changed, 7 insertions, 5 deletions
@@ -1,3 +1,2 @@ [pytest] -addopts = --cov=paste/deploy --cov-report=xml --cov-report=html --cov-report=term-missing testpaths = tests @@ -1,2 +1,5 @@ [wheel] universal = true + +[aliases] +test = pytest @@ -42,8 +42,8 @@ setup( packages=find_packages(exclude=['tests']), include_package_data=True, zip_safe=False, - test_suite='nose.collector', - tests_require=['nose>=0.11'], + setup_requires=['pytest-runner'], + tests_require=['pytest'], extras_require={ 'Config': [], 'Paste': ['Paste'], diff --git a/tests/test_config_middleware.py b/tests/test_config_middleware.py index 56c3d04..52ba7d1 100644 --- a/tests/test_config_middleware.py +++ b/tests/test_config_middleware.py @@ -20,7 +20,7 @@ def test_error(): try: from paste.fixture import TestApp except ImportError: - raise SkipTest + raise pytest.skip('unable to import TestApp') wrapped = ConfigMiddleware(app_with_exception, {'test': 1}) test_app = TestApp(wrapped) @@ -9,4 +9,4 @@ deps = pytest pytest-cov commands = - py.test {posargs} + py.test --cov=paste/deploy --cov-report=xml --cov-report=html --cov-report=term-missing {posargs} |