diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-21 10:44:20 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-21 10:44:20 (GMT) |
commit | 6e571d699f681127fd789cf0db3d521565073682 (patch) | |
tree | c42eb2a25a299c232e88e5511293532b4b7b56db /Lib/test/test_pprint.py | |
parent | d6da90f93d6d44365f5c9f6a2290be90ccfc8d60 (diff) | |
download | cpython-6e571d699f681127fd789cf0db3d521565073682.zip cpython-6e571d699f681127fd789cf0db3d521565073682.tar.gz cpython-6e571d699f681127fd789cf0db3d521565073682.tar.bz2 |
Fix test_pprint random dict ordering.
Diffstat (limited to 'Lib/test/test_pprint.py')
-rw-r--r-- | Lib/test/test_pprint.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index 7daf4a7..0c93d0e 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): |