summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-06-16 22:51:22 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-06-16 22:51:22 (GMT)
commit98a379eda141e98aac8e9c6e5f63c9ac9c1dc84a (patch)
tree319c117326115cb347f7a41e96ffcbcc9245d019
parentb47243ae45a0e083bf5f6a48f5aaf7bc84ed566d (diff)
downloadcpython-98a379eda141e98aac8e9c6e5f63c9ac9c1dc84a.zip
cpython-98a379eda141e98aac8e9c6e5f63c9ac9c1dc84a.tar.gz
cpython-98a379eda141e98aac8e9c6e5f63c9ac9c1dc84a.tar.bz2
Add test for bug #751998.
-rw-r--r--Lib/test/test_descr.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 91f33a5..9587596 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1267,6 +1267,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 slotspecials():
if verbose: print "Testing __dict__ and __weakref__ in __slots__..."