1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #20503 - Moved doctest utilities in with the rest of the deprecated test code.

The ``DocTestRunner`` and ``OutputChecker`` were formerly in
``django.test.testcases``, now they are in ``django.test.simple``. This avoids
triggering the ``django.test._doctest`` deprecation message with any import
from ``django.test``. Since these utility classes are undocumented internal
API, they can be moved without a separate deprecation process.

Also removed the deprecation warnings specific to these classes, as they are
now covered by the module-level warning in ``django.test.simple``.

Thanks Anssi for the report.

Refs #17365.
This commit is contained in:
Carl Meyer
2013-05-27 14:41:39 -06:00
parent 0027f13904
commit cd79f33723
4 changed files with 78 additions and 95 deletions

View File

@@ -345,21 +345,15 @@ support some types of tests that were supported by the previous runner:
your test suite, follow the `recommendations in the Python documentation`_.
Django bundles a modified version of the :mod:`doctest` module from the Python
standard library (in ``django.test._doctest``) in order to allow passing in a
custom ``DocTestRunner`` when instantiating a ``DocTestSuite``, and includes
some additional doctest utilities (``django.test.testcases.DocTestRunner``
turns on the ``ELLIPSIS`` option by default, and
``django.test.testcases.OutputChecker`` provides better matching of XML, JSON,
and numeric data types).
These utilities are deprecated and will be removed in Django 1.8; doctest
suites should be updated to work with the standard library's doctest module (or
converted to unittest-compatible tests).
standard library (in ``django.test._doctest``) and includes some additional
doctest utilities. These utilities are deprecated and will be removed in Django
1.8; doctest suites should be updated to work with the standard library's
doctest module (or converted to unittest-compatible tests).
If you wish to delay updates to your test suite, you can set your
:setting:`TEST_RUNNER` setting to ``django.test.simple.DjangoTestSuiteRunner``
to fully restore the old test behavior. ``DjangoTestSuiteRunner`` is
deprecated but will not be removed from Django until version 1.8.
to fully restore the old test behavior. ``DjangoTestSuiteRunner`` is deprecated
but will not be removed from Django until version 1.8.
.. _recommendations in the Python documentation: http://docs.python.org/2/library/doctest.html#unittest-api