Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~

Expand Down
8 changes: 8 additions & 0 deletions doc/for-test-authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
12 changes: 10 additions & 2 deletions testtools/distutilscmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,15 +20,22 @@ 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')")
]

def __init__(self, dist):
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
Expand Down