]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19664: test_userdict's repr test no longer depends on the order
authorChristian Heimes <christian@cheimes.de>
Fri, 22 Nov 2013 00:16:56 +0000 (01:16 +0100)
committerChristian Heimes <christian@cheimes.de>
Fri, 22 Nov 2013 00:16:56 +0000 (01:16 +0100)
of dict elements.
Original patch by Serhiy Storchaka

Lib/test/test_userdict.py
Misc/NEWS

index 137c445eaeef70fdee8f68ab0d77101e51add212..4d89965b5a75af0e0ea6561b13e73373bab2bac0 100644 (file)
@@ -45,7 +45,8 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
         # Test __repr__
         self.assertEqual(str(u0), str(d0))
         self.assertEqual(repr(u1), repr(d1))
-        self.assertEqual(repr(u2), repr(d2))
+        self.assertIn(repr(u2), ("{'one': 1, 'two': 2}",
+                                 "{'two': 2, 'one': 1}"))
 
         # Test rich comparison and __len__
         all = [d0, d1, d2, u, u0, u1, u2, uu, uu0, uu1, uu2]
index f1f0680ad9bcdb3f9a862a31d9c03b74e0f78db3..d6158d84b73d8ca3544cfe9f6d16206531677cdd 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -306,6 +306,9 @@ Library
 Tests
 -----
 
+- Issue #19664: test_userdict's repr test no longer depends on the order
+  of dict elements.
+
 - Issue #19440: Clean up test_capi by removing an unnecessary __future__
   import, converting from test_main to unittest.main, and running the
   _testcapi module tests as subTests of a unittest TestCase method.