summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-05-18 10:06:40 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-05-18 10:06:40 -0400
commita2043b0816f584b63cd10448f780bd5a6325e214 (patch)
treea73dbe68c26aab1e7d8a8cd09b827bc54f59807b
parentc199ca540c2046b8c9eb54f84ca2082a7a14fc9a (diff)
downloadpytest-runner-a2043b0816f584b63cd10448f780bd5a6325e214.tar.gz
Removed deprecated functionality2.0
-rw-r--r--README30
-rw-r--r--ptr.py25
2 files changed, 14 insertions, 41 deletions
diff --git a/README b/README
index c72e057..d2dcae5 100644
--- a/README
+++ b/README
@@ -4,31 +4,29 @@ pytest-runner
Setup scripts can use pytest-runner to add setup.py test support for pytest
runner.
-Recommended usage
------------------
+Usage
+-----
-- Add 'pytest-runner' to your 'setup_requires'. Pin to '>=1.0,<2.0dev' (or
+- Add 'pytest-runner' to your 'setup_requires'. Pin to '>=2.0,<3dev' (or
similar) to avoid pulling in incompatible versions.
- Include 'pytest' and any other testing requirements to 'tests_require'.
- Invoke tests with `setup.py ptr`.
-Alternate usage
----------------
-
-- Include the file `ptr.py` in your repo.
-- Add these lines to your setup.py::
-
- execfile('ptr.py')
- setup_params = PyTest.install(dict(...))
- setuptools.setup(**setup_params)
-
- Where '...' are your normal keyword parameters to setup().
-
-- Invoke your tests with setup.py test.
+See the `jaraco.util <https://bitbucket.org/jaraco/jaraco.util/>`_ project
+for an example.
Changes
-------
+2.0
+~~~
+
+* Removed support for the alternate usage. The recommended usage (as a
+ distutils command) is now the only supported usage.
+* Removed support for the --junitxml parameter to the ptr command. Clients
+ should pass the same parameter (and all other py.test arguments) to py.test
+ via the --addopts parameter.
+
1.1
~~~
diff --git a/ptr.py b/ptr.py
index 3e27da6..30a5e6b 100644
--- a/ptr.py
+++ b/ptr.py
@@ -4,14 +4,11 @@ Implementation
import os as _os
import shlex as _shlex
-import warnings as _warnings
import setuptools.command.test as _pytest_runner_test
class PyTest(_pytest_runner_test.test):
user_options = [
- ('junitxml=', None, "Output jUnit XML test results to specified "
- "file"),
('extras', None, "Install (all) setuptools extras when running tests"),
('index-url=', None, "Specify an index url from which to retrieve "
"dependencies"),
@@ -22,7 +19,6 @@ class PyTest(_pytest_runner_test.test):
]
def initialize_options(self):
- self.junitxml = None
self.extras = False
self.index_url = None
self.allow_hosts = None
@@ -31,12 +27,6 @@ class PyTest(_pytest_runner_test.test):
def finalize_options(self):
if self.addopts:
self.addopts = _shlex.split(self.addopts)
- if self.junitxml:
- # For compatibility, allow junitxml to be provided to the plugin.
- # In the future, junitxml should be specified using addopts.
- _warnings.warn("junitxml is deprecated, use addopts to pass "
- "options to py.test", DeprecationWarning)
- self.addopts.extend(['--junitxml', self.junitxml])
def run(self):
"""
@@ -103,18 +93,3 @@ class PyTest(_pytest_runner_test.test):
sys.argv[1:] = self.addopts
self.result_code = pytest.main()
sys.argv[:] = argv_saved
-
- @classmethod
- def install(cls, setup_params):
- """
- Given a dictionary of keyword parameters to be passed to setup(),
- update those parameters with tests_require and cmdclass to make
- pytest available.
- """
- reqs = setup_params.setdefault('tests_require', [])
- if not any('pytest' in req for req in reqs):
- reqs.extend(['pytest>=2.1.2'])
- setup_params.setdefault('cmdclass', {}).update(
- test=cls,
- )
- return setup_params