summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_weakref.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-05-02 09:06:28 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-05-02 09:06:28 (GMT)
commit91bbd9a7b9735cba07b06400a7c467aab6facfde (patch)
tree14bbad407135d461d54f8e1c066a93c6b9ef363d /Lib/test/test_weakref.py
parent40006e9f7a38bbbcf564c541cb0f2022b952e409 (diff)
downloadcpython-91bbd9a7b9735cba07b06400a7c467aab6facfde.zip
cpython-91bbd9a7b9735cba07b06400a7c467aab6facfde.tar.gz
cpython-91bbd9a7b9735cba07b06400a7c467aab6facfde.tar.bz2
Used sets.Set() to compare unordered sequences.
Improves clarity and brevity.
Diffstat (limited to 'Lib/test/test_weakref.py')
-rw-r--r--Lib/test/test_weakref.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index eb87720..7e7d068 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -4,6 +4,7 @@ import UserList
import weakref
from test import test_support
+from sets import Set
class C:
@@ -340,9 +341,7 @@ class MappingTestCase(TestBase):
"wrong object returned by weak dict!")
items1 = dict.items()
items2 = dict.copy().items()
- items1.sort()
- items2.sort()
- self.assert_(items1 == items2,
+ self.assert_(Set(items1) == Set(items2),
"cloning of weak-keyed dictionary did not work!")
del items1, items2
self.assert_(len(dict) == self.COUNT)