summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@jelmer.uk>2022-01-24 19:41:08 +0000
committerGitHub <noreply@github.com>2022-01-24 19:41:08 +0000
commit80fb7a5054c8dcea32628cecaf90d14263878e2a (patch)
treef92f0adde7801b58ffaa52d89ef2bade79b1b960
parent298e4488f2bca5db9f4dd07f7afa054d746864cd (diff)
parent3f611e2f4f997c8be9d7fad4de09f9e5bb817d3d (diff)
downloadtesttools-80fb7a5054c8dcea32628cecaf90d14263878e2a.tar.gz
Merge pull request #318 from stephenfin/deprecate-distutils-integration
Deprecate distutils integration
-rw-r--r--NEWS3
-rw-r--r--doc/for-test-authors.rst8
-rw-r--r--testtools/distutilscmd.py12
3 files changed, 21 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index c7eb486..34d0a7c 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ Improvements
* Add support for Python 3.10.
(Jürgen Gmach)
+* Distutils integration is deprecated and will be removed in the next major
+ version.
+
2.5.0
~~~~~
diff --git a/doc/for-test-authors.rst b/doc/for-test-authors.rst
index 90bd3ca..5261154 100644
--- a/doc/for-test-authors.rst
+++ b/doc/for-test-authors.rst
@@ -92,6 +92,14 @@ From now on, we'll assume that you know how to run your tests.
Running test with Distutils
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. deprecated:: 2.6.0
+
+ Distutils integration was deprecated in 2.6.0. You should consider
+ replacing invocations of ``python setup.py test`` with a suitable
+ alternative such as ``tox``. Refer to `this issue`__ for more information.
+
+ .. __: https://github.com/pypa/setuptools/issues/1684
+
If you are using Distutils_ to build your Python project, you can use the testtools
Distutils_ command to integrate testtools into your Distutils_ workflow::
diff --git a/testtools/distutilscmd.py b/testtools/distutilscmd.py
index a4d79dc..eedc4ff 100644
--- a/testtools/distutilscmd.py
+++ b/testtools/distutilscmd.py
@@ -3,6 +3,7 @@
"""Extensions to the standard Python unittest library."""
import sys
+import warnings
from distutils.core import Command
from distutils.errors import DistutilsOptionError
@@ -19,8 +20,8 @@ class TestCommand(Command):
('catch', 'c', "Catch ctrl-C and display results so far"),
('buffer', 'b', "Buffer stdout and stderr during tests"),
('failfast', 'f', "Stop on first fail or error"),
- ('test-module=','m', "Run 'test_suite' in specified module"),
- ('test-suite=','s',
+ ('test-module=', 'm', "Run 'test_suite' in specified module"),
+ ('test-suite=', 's',
"Test suite to run (e.g. 'some_module.test_suite')")
]
@@ -28,6 +29,13 @@ class TestCommand(Command):
Command.__init__(self, dist)
self.runner = TestToolsTestRunner(stdout=sys.stdout)
+ warnings.warn(
+ "Distutils integration is deprecated and will be removed in the "
+ "next major release. "
+ "Refer to https://github.com/pypa/setuptools/issues/1684 for more "
+ "information.",
+ DeprecationWarning,
+ )
def initialize_options(self):
self.test_suite = None