diff options
Diffstat (limited to 'Lib/test/test_repr.py')
-rw-r--r-- | Lib/test/test_repr.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_repr.py b/Lib/test/test_repr.py index a07ed71..6284f40 100644 --- a/Lib/test/test_repr.py +++ b/Lib/test/test_repr.py @@ -196,6 +196,16 @@ class ReprTests(unittest.TestCase): x = classmethod(C.foo) self.failUnless(repr(x).startswith('<classmethod object at 0x')) + def test_unsortable(self): + # Repr.repr() used to call sorted() on sets, frozensets and dicts + # without taking into account that not all objects are comparable + x = set([1j, 2j, 3j]) + y = frozenset(x) + z = {1j: 1, 2j: 2} + r(x) + r(y) + r(z) + def touch(path, text=''): fp = open(path, 'w') fp.write(text) |