Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3fa8c207
Commit
3fa8c207
authored
Aug 23, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Misc cleanups.
parent
b6a04d68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
28 deletions
+26
-28
Lib/doctest.py
Lib/doctest.py
+26
-28
No files found.
Lib/doctest.py
View file @
3fa8c207
...
...
@@ -1555,7 +1555,7 @@ class OutputChecker:
# This flag causes doctest to ignore any differences in the
# contents of whitespace strings. Note that this can be used
# in conjunction with the ELLI
SP
IS flag.
# in conjunction with the ELLI
PS
IS flag.
if optionflags & NORMALIZE_WHITESPACE:
got = '
'.join(got.split())
want = '
'.join(want.split())
...
...
@@ -2435,6 +2435,7 @@ __test__ = {"_TestClass": _TestClass,
>>> x + y, x * y
(3, 2)
"""
,
"bool-int equivalence"
:
r"""
In 2.2, boolean expressions displayed
0 or 1. By default, we still accept
...
...
@@ -2450,30 +2451,32 @@ __test__ = {"_TestClass": _TestClass,
>>> 4 > 4
False
"""
,
"blank lines"
:
r"""
Blank lines can be marked with <BLANKLINE>:
>>> print 'foo\n\nbar\n'
foo
<BLANKLINE>
bar
<BLANKLINE>
Blank lines can be marked with <BLANKLINE>:
>>> print 'foo\n\nbar\n'
foo
<BLANKLINE>
bar
<BLANKLINE>
"""
,
"ellipsis"
:
r"""
If the ellipsis flag is used, then '...' can be used to
elide substrings in the desired output:
>>> print range(1000) #doctest: +ELLIPSIS
[0, 1, 2, ..., 999]
"""
,
"whitespace normalization"
:
r"""
If the whitespace normalization flag is used, then
differences in whitespace are ignored.
>>> print range(30) #doctest: +NORMALIZE_WHITESPACE
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29]
"""
,
}
# "ellipsis": r"""
# If the ellipsis flag is used, then '...' can be used to
# elide substrings in the desired output:
# >>> print range(1000)
# [0, 1, 2, ..., 999]
# """,
# "whitespace normalization": r"""
# If the whitespace normalization flag is used, then
# differences in whitespace are ignored.
# >>> print range(30)
# [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
# 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
# 27, 28, 29]
# """,
# }
}
def
test1
():
r"""
>>> warnings.filterwarnings("ignore", "class Tester", DeprecationWarning,
...
...
@@ -2592,11 +2595,6 @@ def test4(): """
"""
def
_test
():
#import doctest
#doctest.testmod(doctest, verbose=False,
# optionflags=ELLIPSIS | NORMALIZE_WHITESPACE |
# UNIFIED_DIFF)
#print '~'*70
r
=
unittest
.
TextTestRunner
()
r
.
run
(
DocTestSuite
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment