mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Nailed test_weakref.py. Pfew, messy!
This commit is contained in:
parent
9afbb4e364
commit
07f2436fa8
4 changed files with 42 additions and 39 deletions
|
@ -844,19 +844,19 @@ class MappingTestCase(TestBase):
|
|||
self.assert_(len(items) == 0, "iteritems() did not touch all items")
|
||||
|
||||
# key iterator, via __iter__():
|
||||
keys = dict.keys()
|
||||
keys = list(dict.keys())
|
||||
for k in dict:
|
||||
keys.remove(k)
|
||||
self.assert_(len(keys) == 0, "__iter__() did not touch all keys")
|
||||
|
||||
# key iterator, via iterkeys():
|
||||
keys = dict.keys()
|
||||
keys = list(dict.keys())
|
||||
for k in dict.keys():
|
||||
keys.remove(k)
|
||||
self.assert_(len(keys) == 0, "iterkeys() did not touch all keys")
|
||||
|
||||
# value iterator:
|
||||
values = dict.values()
|
||||
values = list(dict.values())
|
||||
for v in dict.values():
|
||||
values.remove(v)
|
||||
self.assert_(len(values) == 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue