mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
SF patch 1167316: doctest.py fails self-test if run directly.
Patch by Ilya Sandler. Bugfix candidate.
This commit is contained in:
parent
7026a0aeef
commit
b7e99b642f
1 changed files with 5 additions and 5 deletions
|
@ -2071,24 +2071,24 @@ def set_unittest_reportflags(flags):
|
||||||
The old flag is returned so that a runner could restore the old
|
The old flag is returned so that a runner could restore the old
|
||||||
value if it wished to:
|
value if it wished to:
|
||||||
|
|
||||||
>>> old = _unittest_reportflags
|
>>> import doctest
|
||||||
>>> set_unittest_reportflags(REPORT_NDIFF |
|
>>> old = doctest._unittest_reportflags
|
||||||
|
>>> doctest.set_unittest_reportflags(REPORT_NDIFF |
|
||||||
... REPORT_ONLY_FIRST_FAILURE) == old
|
... REPORT_ONLY_FIRST_FAILURE) == old
|
||||||
True
|
True
|
||||||
|
|
||||||
>>> import doctest
|
|
||||||
>>> doctest._unittest_reportflags == (REPORT_NDIFF |
|
>>> doctest._unittest_reportflags == (REPORT_NDIFF |
|
||||||
... REPORT_ONLY_FIRST_FAILURE)
|
... REPORT_ONLY_FIRST_FAILURE)
|
||||||
True
|
True
|
||||||
|
|
||||||
Only reporting flags can be set:
|
Only reporting flags can be set:
|
||||||
|
|
||||||
>>> set_unittest_reportflags(ELLIPSIS)
|
>>> doctest.set_unittest_reportflags(ELLIPSIS)
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
ValueError: ('Only reporting flags allowed', 8)
|
ValueError: ('Only reporting flags allowed', 8)
|
||||||
|
|
||||||
>>> set_unittest_reportflags(old) == (REPORT_NDIFF |
|
>>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF |
|
||||||
... REPORT_ONLY_FIRST_FAILURE)
|
... REPORT_ONLY_FIRST_FAILURE)
|
||||||
True
|
True
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue