summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dent <chris.dent@gmail.com>2018-11-26 11:53:23 +0000
committerGitHub <noreply@github.com>2018-11-26 11:53:23 +0000
commiteacb37de3de476c191a4471770ba08ff2939b241 (patch)
tree0168c24b2e98c747b8c422b66deff075e34a54de
parentd18b0527373ca9cdfe90cf340de18e5ab1c1eecf (diff)
downloadpastedeploy-git-eacb37de3de476c191a4471770ba08ff2939b241.tar.gz
Make 'python setup.py test' work (#5)
* 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. * Remove usedevelop from tox.ini Review of improvements to setup.py indicated issues with the tox.ini.
-rw-r--r--pytest.ini1
-rw-r--r--setup.cfg3
-rw-r--r--setup.py4
-rw-r--r--tests/test_config_middleware.py2
-rw-r--r--tox.ini3
5 files changed, 7 insertions, 6 deletions
diff --git a/pytest.ini b/pytest.ini
index 69d62a0..5ee6477 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,3 +1,2 @@
[pytest]
-addopts = --cov=paste/deploy --cov-report=xml --cov-report=html --cov-report=term-missing
testpaths = tests
diff --git a/setup.cfg b/setup.cfg
index f15c017..3c00092 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,2 +1,5 @@
[wheel]
universal = true
+
+[aliases]
+test = pytest
diff --git a/setup.py b/setup.py
index 79f9d70..2ac2606 100644
--- a/setup.py
+++ b/setup.py
@@ -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)
diff --git a/tox.ini b/tox.ini
index 42469da..9800db2 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,11 +2,10 @@
envlist = py27, py34, py35, py36, py37, pypy, pypy3
[testenv]
-usedevelop = True
deps =
# Paste works on Python 3 since Paste 2.0
Paste
pytest
pytest-cov
commands =
- py.test {posargs}
+ py.test --cov=paste/deploy --cov-report=xml --cov-report=html --cov-report=term-missing {posargs}