]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport 1.194:
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 16 Jun 2003 23:38:27 +0000 (23:38 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 16 Jun 2003 23:38:27 +0000 (23:38 +0000)
Add test for bug #751998.

Lib/test/test_descr.py

index 5d5ccc3bd009ac81553ffcacc3484816e90c3438..a24a0a7d7ba15b6cb79c50f9ddf18e5721920a01 100644 (file)
@@ -1116,6 +1116,22 @@ def slots():
         g==g
     new_objects = len(gc.get_objects())
     vereq(orig_objects, new_objects)
+    class H(object):
+        __slots__ = ['a', 'b']
+        def __init__(self):
+            self.a = 1
+            self.b = 2
+        def __del__(self):
+            assert self.a == 1
+            assert self.b == 2
+
+    save_stderr = sys.stderr
+    sys.stderr = sys.stdout
+    h = H()
+    try:
+        del h
+    finally:
+        sys.stderr = save_stderr
 
 def dynamics():
     if verbose: print "Testing class attribute propagation..."