]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport of 1.122
authorAnthony Baxter <anthonybaxter@gmail.com>
Tue, 29 Mar 2005 12:35:54 +0000 (12:35 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Tue, 29 Mar 2005 12:35:54 +0000 (12:35 +0000)
SF patch 1167316:  doctest.py fails self-test if run directly.

Lib/doctest.py

index 0a13d77586a9000d45b6d5575235bdc64097c6c7..f621b62fe241e64c3e609d0aa49c9f370275a938 100644 (file)
@@ -2071,24 +2071,24 @@ def set_unittest_reportflags(flags):
     The old flag is returned so that a runner could restore the old
     value if it wished to:
 
-      >>> old = _unittest_reportflags
-      >>> set_unittest_reportflags(REPORT_NDIFF |
+      >>> import doctest
+      >>> old = doctest._unittest_reportflags
+      >>> doctest.set_unittest_reportflags(REPORT_NDIFF |
       ...                          REPORT_ONLY_FIRST_FAILURE) == old
       True
 
-      >>> import doctest
       >>> doctest._unittest_reportflags == (REPORT_NDIFF |
       ...                                   REPORT_ONLY_FIRST_FAILURE)
       True
 
     Only reporting flags can be set:
 
-      >>> set_unittest_reportflags(ELLIPSIS)
+      >>> doctest.set_unittest_reportflags(ELLIPSIS)
       Traceback (most recent call last):
       ...
       ValueError: ('Only reporting flags allowed', 8)
 
-      >>> set_unittest_reportflags(old) == (REPORT_NDIFF |
+      >>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF |
       ...                                   REPORT_ONLY_FIRST_FAILURE)
       True
     """