summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-02-12 19:30:17 (GMT)
committerFred Drake <fdrake@acm.org>2004-02-12 19:30:17 (GMT)
commit61dafcb6caee4c0971e8aa362b1b170ce19199eb (patch)
tree7913b39239e82820c482ce58cd31d7ecd9cf12d7
parentce3caf2e7abd1d70da5063f2336a2f4b06450341 (diff)
downloadcpython-61dafcb6caee4c0971e8aa362b1b170ce19199eb.zip
cpython-61dafcb6caee4c0971e8aa362b1b170ce19199eb.tar.gz
cpython-61dafcb6caee4c0971e8aa362b1b170ce19199eb.tar.bz2
use existing test object instead of defining a new class
-rw-r--r--Lib/test/test_weakref.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index b2d266d..9ec607e 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -602,22 +602,20 @@ class ReferencesTestCase(TestBase):
thresholds = gc.get_threshold()
gc.set_threshold(1, 1, 1)
gc.collect()
- class A:
- pass
def callback(*args):
pass
- referenced = A()
+ referenced = C()
- a = A()
+ a = C()
a.a = a
a.wr = makeref(referenced)
try:
# now make sure the object and the ref get labeled as
# cyclic trash:
- a = A()
+ a = C()
a.wrc = weakref.ref(referenced, callback)
finally: