summaryrefslogtreecommitdiffstats
path: root/Doc/library/doctest.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-09-01 13:51:09 (GMT)
committerGeorg Brandl <georg@python.org>2007-09-01 13:51:09 (GMT)
commit55ac8f0f26efdbbcb5cc197f9369d23d50bee908 (patch)
treea0d5b7128c055d8c767652dc3948c3404be06396 /Doc/library/doctest.rst
parent1617457cff847fed9fadb01f1acf6ba8bb621726 (diff)
downloadcpython-55ac8f0f26efdbbcb5cc197f9369d23d50bee908.zip
cpython-55ac8f0f26efdbbcb5cc197f9369d23d50bee908.tar.gz
cpython-55ac8f0f26efdbbcb5cc197f9369d23d50bee908.tar.bz2
Get rid of the remaining versionadded/versionchanged directives.
Diffstat (limited to 'Doc/library/doctest.rst')
-rw-r--r--Doc/library/doctest.rst80
1 files changed, 4 insertions, 76 deletions
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst
index 4f4f511..a448880 100644
--- a/Doc/library/doctest.rst
+++ b/Doc/library/doctest.rst
@@ -290,9 +290,6 @@ strings are treated as if they were docstrings. In output, a key ``K`` in
Any classes found are recursively searched similarly, to test docstrings in
their contained methods and nested classes.
-.. versionchanged:: 2.4
- A "private name" concept is deprecated and no longer documented.
-
.. _doctest-finding-examples:
@@ -305,10 +302,6 @@ hard tab characters are expanded to spaces, using 8-column tab stops. If you
don't believe tabs should mean that, too bad: don't use hard tabs, or write
your own :class:`DocTestParser` class.
-.. versionchanged:: 2.4
- Expanding tabs to spaces is new; previous versions tried to preserve hard tabs,
- with confusing results.
-
::
>>> # comments are ignored
@@ -338,10 +331,6 @@ The fine print:
blank line, put ``<BLANKLINE>`` in your doctest example each place a blank line
is expected.
- .. versionchanged:: 2.4
- ``<BLANKLINE>`` was added; there was no way to use expected output containing
- empty lines in previous versions.
-
* Output to stdout is captured, but not output to stderr (exception tracebacks
are captured via a different means).
@@ -498,10 +487,6 @@ Some details you should read once, but won't need to remember:
^
SyntaxError: invalid syntax
-.. versionchanged:: 2.4
- The ability to handle a multi-line exception detail, and the
- :const:`IGNORE_EXCEPTION_DETAIL` doctest option, were added.
-
.. _doctest-options:
@@ -663,7 +648,7 @@ two blanks before the single-digit list elements, and because the actual output
is on a single line. This test also passes, and also requires a directive to do
so::
- >>> print range(20) # doctest:+ELLIPSIS
+ >>> print range(20) # doctest: +ELLIPSIS
[0, 1, ..., 18, 19]
Multiple directives can be used on a single physical line, separated by commas::
@@ -692,17 +677,6 @@ usually the only meaningful choice. However, option flags can also be passed to
functions that run doctests, establishing different defaults. In such cases,
disabling an option via ``-`` in a directive can be useful.
-.. versionchanged:: 2.4
- Constants :const:`DONT_ACCEPT_BLANKLINE`, :const:`NORMALIZE_WHITESPACE`,
- :const:`ELLIPSIS`, :const:`IGNORE_EXCEPTION_DETAIL`, :const:`REPORT_UDIFF`,
- :const:`REPORT_CDIFF`, :const:`REPORT_NDIFF`,
- :const:`REPORT_ONLY_FIRST_FAILURE`, :const:`COMPARISON_FLAGS` and
- :const:`REPORTING_FLAGS` were added; by default ``<BLANKLINE>`` in expected
- output matches an empty line in actual output; and doctest directives were
- added.
-
-.. versionchanged:: 2.5
- Constant :const:`SKIP` was added.
There's also a way to register new option flag names, although this isn't useful
unless you intend to extend :mod:`doctest` internals via subclassing:
@@ -718,8 +692,6 @@ unless you intend to extend :mod:`doctest` internals via subclassing:
MY_FLAG = register_optionflag('MY_FLAG')
- .. versionadded:: 2.4
-
.. _doctest-warnings:
@@ -868,11 +840,6 @@ and :ref:`doctest-simple-testfile`.
Optional argument *encoding* specifies an encoding that should be used to
convert the file to unicode.
- .. versionadded:: 2.4
-
- .. versionchanged:: 2.5
- The parameter *encoding* was added.
-
.. function:: testmod([m][, name][, globs][, verbose][, report][, optionflags][, extraglobs][, raise_on_error][, exclude_empty])
@@ -906,14 +873,6 @@ and :ref:`doctest-simple-testfile`.
*raise_on_error*, and *globs* are the same as for function :func:`testfile`
above, except that *globs* defaults to ``m.__dict__``.
- .. versionchanged:: 2.3
- The parameter *optionflags* was added.
-
- .. versionchanged:: 2.4
- The parameters *extraglobs*, *raise_on_error* and *exclude_empty* were added.
-
- .. versionchanged:: 2.5
- The optional argument *isprivate*, deprecated in 2.4, was removed.
There's also a function to run the doctests associated with a single object.
This function is provided for backward compatibility. There are no plans to
@@ -1031,14 +990,8 @@ from text files and modules with doctests:
Optional argument *encoding* specifies an encoding that should be used to
convert the file to unicode.
- .. versionadded:: 2.4
-
- .. versionchanged:: 2.5
- The global ``__file__`` was added to the globals provided to doctests loaded
- from a text file using :func:`DocFileSuite`.
-
- .. versionchanged:: 2.5
- The parameter *encoding* was added.
+ The global ``__file__`` is added to the globals provided to doctests loaded
+ from a text file using :func:`DocFileSuite`.
.. function:: DocTestSuite([module][, globs][, extraglobs][, test_finder][, setUp][, tearDown][, checker])
@@ -1068,12 +1021,8 @@ from text files and modules with doctests:
Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as for
function :func:`DocFileSuite` above.
- .. versionadded:: 2.3
+ This function uses the same search technique as :func:`testmod`.
- .. versionchanged:: 2.4
- The parameters *globs*, *extraglobs*, *test_finder*, *setUp*, *tearDown*, and
- *optionflags* were added; this function now uses the same search technique as
- :func:`testmod`.
Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` out
of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a
@@ -1119,8 +1068,6 @@ reporting flags specific to :mod:`unittest` support, via this function:
The value of the :mod:`unittest` reporting flags in effect before the function
was called is returned by the function.
- .. versionadded:: 2.4
-
.. _doctest-advanced-api:
@@ -1181,7 +1128,6 @@ DocTest Objects
constructor arguments are used to initialize the member variables of the same
names.
- .. versionadded:: 2.4
:class:`DocTest` defines the following member variables. They are initialized
by the constructor, and should not be modified directly.
@@ -1239,7 +1185,6 @@ Example Objects
output. The constructor arguments are used to initialize the member variables
of the same names.
- .. versionadded:: 2.4
:class:`Example` defines the following member variables. They are initialized
by the constructor, and should not be modified directly.
@@ -1316,7 +1261,6 @@ DocTestFinder objects
If the optional argument *exclude_empty* is false, then
:meth:`DocTestFinder.find` will include tests for objects with empty docstrings.
- .. versionadded:: 2.4
:class:`DocTestFinder` defines the following method:
@@ -1369,7 +1313,6 @@ DocTestParser objects
A processing class used to extract interactive examples from a string, and use
them to create a :class:`DocTest` object.
- .. versionadded:: 2.4
:class:`DocTestParser` defines the following methods:
@@ -1438,7 +1381,6 @@ DocTestRunner objects
runner compares expected output to actual output, and how it displays failures.
For more information, see section :ref:`doctest-options`.
- .. versionadded:: 2.4
:class:`DocTestParser` defines the following methods:
@@ -1530,11 +1472,9 @@ OutputChecker objects
if they match; and :meth:`output_difference`, which returns a string describing
the differences between two outputs.
- .. versionadded:: 2.4
:class:`OutputChecker` defines the following methods:
-
.. method:: OutputChecker.check_output(want, got, optionflags)
Return ``True`` iff the actual output from an example (*got*) matches the
@@ -1616,8 +1556,6 @@ Doctest provides several mechanisms for debugging doctest examples:
(0, 3)
>>>
- .. versionchanged:: 2.4
- The ability to use :func:`pdb.set_trace` usefully inside doctests was added.
Functions that convert doctests to Python code, and possibly run the synthesized
code under the debugger:
@@ -1656,8 +1594,6 @@ code under the debugger:
useful when you want to transform an interactive Python session into a Python
script.
- .. versionadded:: 2.4
-
.. function:: testsource(module, name)
@@ -1676,8 +1612,6 @@ code under the debugger:
prints a script version of function :func:`f`'s docstring, with doctests
converted to code, and the rest placed in comments.
- .. versionadded:: 2.3
-
.. function:: debug(module, name[, pm])
@@ -1699,11 +1633,6 @@ code under the debugger:
specified, or is false, the script is run under the debugger from the start, via
passing an appropriate :func:`exec` call to :func:`pdb.run`.
- .. versionadded:: 2.3
-
- .. versionchanged:: 2.4
- The *pm* argument was added.
-
.. function:: debug_src(src[, pm][, globs])
@@ -1718,7 +1647,6 @@ code under the debugger:
execution context. If not specified, or ``None``, an empty dictionary is used.
If specified, a shallow copy of the dictionary is used.
- .. versionadded:: 2.4
The :class:`DebugRunner` class, and the special exceptions it may raise, are of
most interest to testing framework authors, and will only be sketched here. See