diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-10-27 20:05:26 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-10-27 20:05:26 (GMT) |
commit | b0e9bd4741fb3f00ef853ada1ba7e99f33d087f5 (patch) | |
tree | 0b9703dfb0686513bb98cd90cff6b7ff70ee051a /Lib | |
parent | c3d47724c1122bd1df8a821b05976086b140df02 (diff) | |
download | cpython-b0e9bd4741fb3f00ef853ada1ba7e99f33d087f5.zip cpython-b0e9bd4741fb3f00ef853ada1ba7e99f33d087f5.tar.gz cpython-b0e9bd4741fb3f00ef853ada1ba7e99f33d087f5.tar.bz2 |
Merged revisions 75851 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75851 | antoine.pitrou | 2009-10-27 21:02:23 +0100 (mar., 27 oct. 2009) | 3 lines
Suppress transient refleaks in test_threading.
........
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_threading.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 8c4966b..b5b05c3 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -56,7 +56,16 @@ class TestThread(threading.Thread): (self.name, self.nrunning.get())) -class ThreadTests(unittest.TestCase): +class BaseTestCase(unittest.TestCase): + def setUp(self): + self._threads = test.support.threading_setup() + + def tearDown(self): + test.support.threading_cleanup(*self._threads) + test.support.reap_children() + + +class ThreadTests(BaseTestCase): # Create a bunch of threads, let each do some work, wait until all are # done. @@ -389,7 +398,7 @@ class ThreadTests(unittest.TestCase): threading.activeCount() -class ThreadJoinOnShutdown(unittest.TestCase): +class ThreadJoinOnShutdown(BaseTestCase): def _run_and_join(self, script): script = """if 1: @@ -470,7 +479,7 @@ class ThreadJoinOnShutdown(unittest.TestCase): self._run_and_join(script) -class ThreadingExceptionTests(unittest.TestCase): +class ThreadingExceptionTests(BaseTestCase): # A RuntimeError should be raised if Thread.start() is called # multiple times. def test_start_thread_again(self): |