[Python-checkins] python/dist/src/Lib/test test_weakref.py, 1.36,
1.37
fdrake at users.sourceforge.net
fdrake at users.sourceforge.net
Thu Feb 12 14:30:20 EST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16254
Modified Files:
test_weakref.py
Log Message:
use existing test object instead of defining a new class
Index: test_weakref.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** test_weakref.py 12 Feb 2004 17:35:11 -0000 1.36
--- test_weakref.py 12 Feb 2004 19:30:17 -0000 1.37
***************
*** 603,615 ****
gc.set_threshold(1, 1, 1)
gc.collect()
- class A:
- pass
def callback(*args):
pass
! referenced = A()
! a = A()
a.a = a
a.wr = makeref(referenced)
--- 603,613 ----
gc.set_threshold(1, 1, 1)
gc.collect()
def callback(*args):
pass
! referenced = C()
! a = C()
a.a = a
a.wr = makeref(referenced)
***************
*** 618,622 ****
# now make sure the object and the ref get labeled as
# cyclic trash:
! a = A()
a.wrc = weakref.ref(referenced, callback)
--- 616,620 ----
# now make sure the object and the ref get labeled as
# cyclic trash:
! a = C()
a.wrc = weakref.ref(referenced, callback)
More information about the Python-checkins
mailing list