Minimal test for __del__ hook.

This commit is contained in:
Guido van Rossum 2001-10-30 02:33:02 +00:00
parent c32410ae8f
commit ed87ad876b

View file

@ -2408,6 +2408,17 @@ def kwdargs():
list.__init__(a, sequence=[0, 1, 2])
vereq(a, [0, 1, 2])
def delhook():
if verbose: print "Testing __del__ hook..."
log = []
class C(object):
def __del__(self):
log.append(1)
c = C()
vereq(log, [])
del c
vereq(log, [1])
def test_main():
class_docstrings()
lists()
@ -2459,6 +2470,7 @@ def test_main():
buffer_inherit()
str_of_str_subclass()
kwdargs()
delhook()
if verbose: print "All OK"
if __name__ == "__main__":