[Python-checkins] CVS: python/dist/src/Lib/test test_threaded_import.py,1.2,1.3
Jack Jansen
jackjansen@users.sourceforge.net
Wed, 29 Aug 2001 13:26:26 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv26285
Modified Files:
test_threaded_import.py
Log Message:
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.
Index: test_threaded_import.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_threaded_import.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_threaded_import.py 2001/05/22 18:28:25 1.2
--- test_threaded_import.py 2001/08/29 20:26:24 1.3
***************
*** 7,11 ****
import thread
! from test_support import verbose
critical_section = thread.allocate_lock()
--- 7,11 ----
import thread
! from test_support import verbose, TestSkipped
critical_section = thread.allocate_lock()
***************
*** 33,36 ****
--- 33,40 ----
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: