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
3323da92
Commit
3323da92
authored
Apr 11, 2015
by
Ethan Furman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue23826: fix doc test for -OO runs
parent
2995cc68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
4 deletions
+35
-4
Lib/test/test_enum.py
Lib/test/test_enum.py
+35
-4
No files found.
Lib/test/test_enum.py
View file @
3323da92
...
...
@@ -1556,7 +1556,7 @@ class TestUnique(unittest.TestCase):
turkey
=
3
expected_help_output
=
"""
expected_help_output
_with_docs
=
"""
\
Help on class Color in module %s:
class Color(enum.Enum)
...
...
@@ -1593,8 +1593,36 @@ class Color(enum.Enum)
| Returns a mapping of member name->value.
|
\
x20
\
x20
\
x20
\
x20
\
x20
\
x20
| This mapping lists all enum members, including aliases. Note that this
| is a read-only view of the internal mapping.
"""
.
strip
()
| is a read-only view of the internal mapping."""
expected_help_output_without_docs
=
"""
\
Help on class Color in module %s:
class Color(enum.Enum)
| Method resolution order:
| Color
| enum.Enum
| builtins.object
|
\
x20
\
x20
| Data and other attributes defined here:
|
\
x20
\
x20
| blue = <Color.blue: 3>
|
\
x20
\
x20
| green = <Color.green: 2>
|
\
x20
\
x20
| red = <Color.red: 1>
|
\
x20
\
x20
| ----------------------------------------------------------------------
| Data descriptors inherited from enum.Enum:
|
\
x20
\
x20
| name
|
\
x20
\
x20
| value
|
\
x20
\
x20
| ----------------------------------------------------------------------
| Data descriptors inherited from enum.EnumMeta:
|
\
x20
\
x20
| __members__"""
class
TestStdLib
(
unittest
.
TestCase
):
...
...
@@ -1605,7 +1633,10 @@ class TestStdLib(unittest.TestCase):
def
test_pydoc
(
self
):
# indirectly test __objclass__
expected_text
=
expected_help_output
%
__name__
if
StrEnum
.
__doc__
is
None
:
expected_text
=
expected_help_output_without_docs
%
__name__
else
:
expected_text
=
expected_help_output_with_docs
%
__name__
output
=
StringIO
()
helper
=
pydoc
.
Helper
(
output
=
output
)
helper
(
self
.
Color
)
...
...
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