summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2012-11-14 22:37:24 (GMT)
committerPhilip Jenvey <pjenvey@underboss.org>2012-11-14 22:37:24 (GMT)
commitb37ac8eaf610c82c792ed038508b959e1bff686e (patch)
treee28e462ffa049c7afae44e2216f7ade6bea428a4 /Lib/test/test_exceptions.py
parentf9e49eaefc9af96a7e73356d697055bb72e97012 (diff)
downloadcpython-b37ac8eaf610c82c792ed038508b959e1bff686e.zip
cpython-b37ac8eaf610c82c792ed038508b959e1bff686e.tar.gz
cpython-b37ac8eaf610c82c792ed038508b959e1bff686e.tar.bz2
don't gc_collect on CPython to guarantee a lack of ref cycles (thanks Antoine)
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 3c14c80..79bd7ff 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -7,8 +7,8 @@ import pickle
import weakref
import errno
-from test.support import (TESTFN, unlink, run_unittest, captured_output,
- gc_collect, cpython_only)
+from test.support import (TESTFN, captured_output, check_impl_detail,
+ cpython_only, gc_collect, run_unittest, unlink)
# XXX This is not really enough, each *operation* should be tested!
@@ -493,7 +493,9 @@ class ExceptionTests(unittest.TestCase):
e.__context__ = None
obj = None
obj = wr()
- gc_collect()
+ # guarantee no ref cycles on CPython (don't gc_collect)
+ if check_impl_detail(cpython=False):
+ gc_collect()
self.assertTrue(obj is None, "%s" % obj)
# Some complicated construct
@@ -510,7 +512,8 @@ class ExceptionTests(unittest.TestCase):
except MyException:
pass
obj = None
- gc_collect()
+ if check_impl_detail(cpython=False):
+ gc_collect()
obj = wr()
self.assertTrue(obj is None, "%s" % obj)
@@ -525,7 +528,8 @@ class ExceptionTests(unittest.TestCase):
with Context():
inner_raising_func()
obj = None
- gc_collect()
+ if check_impl_detail(cpython=False):
+ gc_collect()
obj = wr()
self.assertTrue(obj is None, "%s" % obj)