From: Christian Heimes Date: Fri, 22 Nov 2013 00:16:56 +0000 (+0100) Subject: Issue #19664: test_userdict's repr test no longer depends on the order X-Git-Tag: v3.4.0b1~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f8b0f5c59f273c195fb20e18d1847b868288b64;p=thirdparty%2FPython%2Fcpython.git Issue #19664: test_userdict's repr test no longer depends on the order of dict elements. Original patch by Serhiy Storchaka --- diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py index 137c445eaeef..4d89965b5a75 100644 --- a/Lib/test/test_userdict.py +++ b/Lib/test/test_userdict.py @@ -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] diff --git a/Misc/NEWS b/Misc/NEWS index f1f0680ad9bc..d6158d84b73d 100644 --- 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.