diff options
author | Tim Peters <tim.peters@gmail.com> | 2006-04-25 03:31:36 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2006-04-25 03:31:36 (GMT) |
commit | 711bf30b898c73a94f56b7edfb7dd10d5999cb27 (patch) | |
tree | 8414796c446936b19ae6949dc5a7cae548847a5e /Lib/doctest.py | |
parent | e96b229d2ad3944592b1889bb277388fec086049 (diff) | |
download | cpython-711bf30b898c73a94f56b7edfb7dd10d5999cb27.zip cpython-711bf30b898c73a94f56b7edfb7dd10d5999cb27.tar.gz cpython-711bf30b898c73a94f56b7edfb7dd10d5999cb27.tar.bz2 |
Patch #1475231: add a new SKIP doctest option, thanks to
Edward Loper.
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r-- | Lib/doctest.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index 70c355a..900d871 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -54,6 +54,7 @@ __all__ = [ 'DONT_ACCEPT_BLANKLINE', 'NORMALIZE_WHITESPACE', 'ELLIPSIS', + 'SKIP', 'IGNORE_EXCEPTION_DETAIL', 'COMPARISON_FLAGS', 'REPORT_UDIFF', @@ -136,12 +137,14 @@ DONT_ACCEPT_TRUE_FOR_1 = register_optionflag('DONT_ACCEPT_TRUE_FOR_1') DONT_ACCEPT_BLANKLINE = register_optionflag('DONT_ACCEPT_BLANKLINE') NORMALIZE_WHITESPACE = register_optionflag('NORMALIZE_WHITESPACE') ELLIPSIS = register_optionflag('ELLIPSIS') +SKIP = register_optionflag('SKIP') IGNORE_EXCEPTION_DETAIL = register_optionflag('IGNORE_EXCEPTION_DETAIL') COMPARISON_FLAGS = (DONT_ACCEPT_TRUE_FOR_1 | DONT_ACCEPT_BLANKLINE | NORMALIZE_WHITESPACE | ELLIPSIS | + SKIP | IGNORE_EXCEPTION_DETAIL) REPORT_UDIFF = register_optionflag('REPORT_UDIFF') @@ -1233,6 +1236,10 @@ class DocTestRunner: else: self.optionflags &= ~optionflag + # If 'SKIP' is set, then skip this example. + if self.optionflags & SKIP: + continue + # Record that we started this example. tries += 1 if not quiet: @@ -1792,6 +1799,7 @@ def testmod(m=None, name=None, globs=None, verbose=None, isprivate=None, DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS + SKIP IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF @@ -1914,6 +1922,7 @@ def testfile(filename, module_relative=True, name=None, package=None, DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS + SKIP IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF |