summaryrefslogtreecommitdiff
path: root/Lib/test/test_threadedtempfile.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-18 19:35:01 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-18 19:35:01 +0000
commit9602cc2aa43e489a61df800013bc7767094ede91 (patch)
tree867065f44f023c9f1c26bcdafeec7107e8afffc7 /Lib/test/test_threadedtempfile.py
parentf5da071ec8ec0b84acd8d1038e1c4b584158ff63 (diff)
downloadcpython-git-9602cc2aa43e489a61df800013bc7767094ede91.tar.gz
Prevent spurious leaks when running regrtest.py -R. There may be more
issues that crop up from time to time, but this change seems to have been pretty stable (no spurious warnings) for about a week. Other modules which use threads may require similar use of threading_setup/threading_cleanup from test_support.
Diffstat (limited to 'Lib/test/test_threadedtempfile.py')
-rw-r--r--Lib/test/test_threadedtempfile.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_threadedtempfile.py b/Lib/test/test_threadedtempfile.py
index 459ba3a1e4..974333b486 100644
--- a/Lib/test/test_threadedtempfile.py
+++ b/Lib/test/test_threadedtempfile.py
@@ -22,7 +22,7 @@ FILES_PER_THREAD = 50 # change w/ -f option
import thread # If this fails, we can't test this module
import threading
-from test.test_support import TestFailed
+from test.test_support import TestFailed, threading_setup, threading_cleanup
import StringIO
from traceback import print_exc
import tempfile
@@ -48,6 +48,7 @@ class TempFileGreedy(threading.Thread):
def test_main():
threads = []
+ thread_info = threading_setup()
print "Creating"
for i in range(NUM_THREADS):
@@ -72,6 +73,7 @@ def test_main():
if errors:
raise TestFailed(msg)
+ threading_cleanup(*thread_info)
if __name__ == "__main__":
import sys, getopt