[Python-checkins] cpython (3.2): Fix test_pprint random dict ordering.
florent.xicluna
python-checkins at python.org
Sat Jul 21 12:45:19 CEST 2012
http://hg.python.org/cpython/rev/29642f82bbcc
changeset: 78214:29642f82bbcc
branch: 3.2
parent: 78212:03cda5360dc6
user: Florent Xicluna <florent.xicluna at gmail.com>
date: Sat Jul 21 12:44:20 2012 +0200
summary:
Fix test_pprint random dict ordering.
files:
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
--- a/Lib/test/test_pprint.py
+++ b/Lib/test/test_pprint.py
@@ -467,8 +467,9 @@
'{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):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list