summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-08-11 04:15:09 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-08-11 04:15:09 (GMT)
commitd92ae840e940db2fc8e9ec6293fe22dbb73f4514 (patch)
tree306a0470454014aa96564ddb8c4f57ed47f71427 /Lib
parenta1ad3f08ad1ce102636e75782d31d4f3cd7893a7 (diff)
downloadcpython-d92ae840e940db2fc8e9ec6293fe22dbb73f4514.zip
cpython-d92ae840e940db2fc8e9ec6293fe22dbb73f4514.tar.gz
cpython-d92ae840e940db2fc8e9ec6293fe22dbb73f4514.tar.bz2
test_saveall(): Another small simplification; plus s/l/L/g.
test_del(), test_del_newclass(): No need to use apply() in these.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_gc.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index 1e684bf..95cea29 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -174,21 +174,19 @@ def test_saveall():
gc.collect()
vereq(gc.garbage, []) # if this fails, someone else created immortal trash
- l = []
- l.append(l)
- id_l = id(l)
+ L = []
+ L.append(L)
+ id_L = id(L)
debug = gc.get_debug()
gc.set_debug(debug | gc.DEBUG_SAVEALL)
- del l
+ del L
gc.collect()
gc.set_debug(debug)
vereq(len(gc.garbage), 1)
- if id(gc.garbage[0]) == id_l:
- del gc.garbage[0]
- else:
- raise TestFailed, "didn't find obj in garbage (saveall)"
+ obj = gc.garbage.pop()
+ vereq(id(obj), id_L)
def test_del():
# __del__ methods can trigger collection, make this to happen
@@ -203,7 +201,7 @@ def test_del():
del a
gc.disable()
- apply(gc.set_threshold, thresholds)
+ gc.set_threshold(*thresholds)
def test_del_newclass():
# __del__ methods can trigger collection, make this to happen
@@ -218,7 +216,7 @@ def test_del_newclass():
del a
gc.disable()
- apply(gc.set_threshold, thresholds)
+ gc.set_threshold(*thresholds)
class Ouch:
n = 0