summaryrefslogtreecommitdiff
path: root/Lib/test/test_pprint.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2012-07-21 12:44:20 +0200
committerFlorent Xicluna <florent.xicluna@gmail.com>2012-07-21 12:44:20 +0200
commit0e456158b513bbf29b1fa13f2ce9e6cae15bb38d (patch)
tree1c03b8dd893cf0b62b9fa92eab28bae00e61a97b /Lib/test/test_pprint.py
parent4dd889b8fc79fd34d7151991059b4d8ccbe2c6b2 (diff)
downloadcpython-0e456158b513bbf29b1fa13f2ce9e6cae15bb38d.tar.gz
Fix test_pprint random dict ordering.
Diffstat (limited to 'Lib/test/test_pprint.py')
-rw-r--r--Lib/test/test_pprint.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py
index 7daf4a7b60..0c93d0e59b 100644
--- a/Lib/test/test_pprint.py
+++ b/Lib/test/test_pprint.py
@@ -467,8 +467,9 @@ class QueryTestCase(unittest.TestCase):
'{1: 0, ' + repr(Unorderable) +': 0}')
# Issue 14998: TypeError on tuples with NoneTypes as dict keys.
- self.assertEqual(pprint.pformat({(1,): 0, (None,): 0}),
- '{(1,): 0, (None,): 0}')
+ keys = [(1,), (None,)]
+ self.assertEqual(pprint.pformat(dict.fromkeys(keys, 0)),
+ '{%r: 0, %r: 0}' % tuple(sorted(keys, key=id)))
class DottedPrettyPrinter(pprint.PrettyPrinter):