summaryrefslogtreecommitdiff
path: root/Lib/test/test_threaded_import.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-08-29 20:26:24 +0000
committerJack Jansen <jack.jansen@cwi.nl>2001-08-29 20:26:24 +0000
commitb29cc85ada555b34b047a55c73ba876954d9d6de (patch)
treee3020461dbd0d8b2df20e1a008ea172d132e62db /Lib/test/test_threaded_import.py
parent8cc51c92b0db2b6e5b694910bdd549a58a2e8265 (diff)
downloadcpython-b29cc85ada555b34b047a55c73ba876954d9d6de.tar.gz
Workaround by Tim Peters to skip this test if run from test.autotest,
in which case it will hang because the import lock is already held by the main thread.
Diffstat (limited to 'Lib/test/test_threaded_import.py')
-rw-r--r--Lib/test/test_threaded_import.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py
index fafb8737de..1e1c55321f 100644
--- a/Lib/test/test_threaded_import.py
+++ b/Lib/test/test_threaded_import.py
@@ -6,7 +6,7 @@
# randrange, and then Python hangs.
import thread
-from test_support import verbose
+from test_support import verbose, TestSkipped
critical_section = thread.allocate_lock()
done = thread.allocate_lock()
@@ -32,6 +32,10 @@ def task():
def test_main(): # magic name! see above
global N, done
+ import sys
+ for modname in sys.modules:
+ if modname.find('autotest') >= 0:
+ raise TestSkipped("can't run from autotest")
done.acquire()
for N in (20, 50) * 3:
if verbose: