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
c944cfc7
Commit
c944cfc7
authored
Sep 21, 2010
by
Daniel Stutzbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue9131: Mark fragile test as CPython-specific
parent
2f816e6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
Lib/test/test_pprint.py
Lib/test/test_pprint.py
+22
-0
No files found.
Lib/test/test_pprint.py
View file @
c944cfc7
...
...
@@ -219,7 +219,29 @@ class QueryTestCase(unittest.TestCase):
others.should.not.be: like.this}"""
self
.
assertEqual
(
DottedPrettyPrinter
().
pformat
(
o
),
exp
)
@
test
.
support
.
cpython_only
def
test_set_reprs
(
self
):
# This test creates a complex arrangement of frozensets and
# compares the pretty-printed repr against a string hard-coded in
# the test. The hard-coded repr depends on the sort order of
# frozensets.
#
# However, as the docs point out: "Since sets only define
# partial ordering (subset relationships), the output of the
# list.sort() method is undefined for lists of sets."
#
# In a nutshell, the test assumes frozenset({0}) will always
# sort before frozenset({1}), but:
#
# >>> frozenset({0}) < frozenset({1})
# False
# >>> frozenset({1}) < frozenset({0})
# False
#
# Consequently, this test is fragile and
# implementation-dependent. Small changes to Python's sort
# algorithm cause the test to fail when it should pass.
self
.
assertEqual
(
pprint
.
pformat
(
set
()),
'set()'
)
self
.
assertEqual
(
pprint
.
pformat
(
set
(
range
(
3
))),
'{0, 1, 2}'
)
self
.
assertEqual
(
pprint
.
pformat
(
frozenset
()),
'frozenset()'
)
...
...
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