diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-21 10:45:02 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-21 10:45:02 (GMT) |
commit | 0fd1062a7639f2a155fd6d04eb9cebbd4e5118df (patch) | |
tree | d8e4f1b90d270a30887a7a8aca2bda26ae3fb561 /Lib | |
parent | 6a01fc5d4114ac56105ecbfb4ae3cbe043818449 (diff) | |
parent | 6e571d699f681127fd789cf0db3d521565073682 (diff) | |
download | cpython-0fd1062a7639f2a155fd6d04eb9cebbd4e5118df.zip cpython-0fd1062a7639f2a155fd6d04eb9cebbd4e5118df.tar.gz cpython-0fd1062a7639f2a155fd6d04eb9cebbd4e5118df.tar.bz2 |
Fix test_pprint random dict ordering.
Diffstat (limited to 'Lib')
-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 95ffab7..d492d75 100644 --- a/Lib/test/test_pprint.py +++ b/Lib/test/test_pprint.py @@ -471,8 +471,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): |