]> granicus.if.org Git - python/commitdiff
SF patch 1167316: doctest.py fails self-test if run directly.
authorTim Peters <tim.peters@gmail.com>
Mon, 28 Mar 2005 23:50:54 +0000 (23:50 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 28 Mar 2005 23:50:54 +0000 (23:50 +0000)
Patch by Ilya Sandler.

Bugfix candidate.

Lib/doctest.py

index 2708fc7da069644d0446f9d5b5966aad52d27597..e3d4d79930a93b7c4243b63257e72f88ded97db6 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
     """