Commit ed87ad87 authored by Guido van Rossum's avatar Guido van Rossum

Minimal test for __del__ hook.

parent c32410ae
......@@ -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__":
......
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