Kaydet (Commit) 4803c126 authored tarafından Tim Peters's avatar Tim Peters

test_saveall(): Simplified a little, given that we only expect one item

in gc.garbage (so no need to loop looking for it -- it's there or it's
not).
üst c708c0a8
...@@ -180,16 +180,14 @@ def test_saveall(): ...@@ -180,16 +180,14 @@ def test_saveall():
l.append(l) l.append(l)
id_l = id(l) id_l = id(l)
del l del l
gc.collect() gc.collect()
vereq(len(gc.garbage), 1)
try: try:
for obj in gc.garbage: vereq(len(gc.garbage), 1)
if id(obj) == id_l: if id(gc.garbage[0]) == id_l:
del obj[:] del gc.garbage[0]
break
else: else:
raise TestFailed, "didn't find obj in garbage (saveall)" raise TestFailed, "didn't find obj in garbage (saveall)"
gc.garbage.remove(obj)
finally: finally:
gc.set_debug(debug) gc.set_debug(debug)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment