summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-01-10 19:29:24 +0000
committerGeorg Brandl <georg@python.org>2006-01-10 19:29:24 +0000
commit7e8bfa416384d83de697028e3e29d2227394c392 (patch)
treeccf32e32f64f0fc11b271721d54e428af9a281b2 /Lib
parent8cc4ef561c1ba8f36520396c6f631764b55f4643 (diff)
downloadcpython-git-7e8bfa416384d83de697028e3e29d2227394c392.tar.gz
Add outstanding_crashes.py with tests for crashes.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/outstanding_bugs.py3
-rw-r--r--Lib/test/outstanding_crashes.py38
2 files changed, 41 insertions, 0 deletions
diff --git a/Lib/test/outstanding_bugs.py b/Lib/test/outstanding_bugs.py
index be71fde48c..7b17ba8309 100644
--- a/Lib/test/outstanding_bugs.py
+++ b/Lib/test/outstanding_bugs.py
@@ -22,3 +22,6 @@ class TestBug1385040(unittest.TestCase):
def test_main():
test_support.run_unittest(TestBug1385040)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/outstanding_crashes.py b/Lib/test/outstanding_crashes.py
new file mode 100644
index 0000000000..3fa96595b6
--- /dev/null
+++ b/Lib/test/outstanding_crashes.py
@@ -0,0 +1,38 @@
+#
+# This file is for everybody to add tests for crashes that aren't
+# fixed yet. Please add a test case and appropriate description.
+#
+# When you fix one of the crashes, please move the test to the correct
+# test_ module.
+#
+
+import unittest
+from test import test_support
+
+
+# Bug 1377858
+#
+# mwh's description:
+# The problem is obvious if you read typeobject.c around line 660: the weakref
+# list is cleared before __del__ is called, so any weakrefs added during the
+# execution of __del__ are never informed of the object's death.
+
+import weakref
+ref = None
+
+class TestBug1377858(unittest.TestCase):
+ class Target(object):
+ def __del__(self):
+ global ref
+ ref = weakref.ref(self)
+
+ def testBug1377858(self):
+ w = self.__class__.Target()
+ w = None
+ print ref()
+
+def test_main():
+ test_support.run_unittest(TestBug1377858)
+
+if __name__ == "__main__":
+ test_main()