[Python-checkins] CVS: python/dist/src/Lib/test test_socketserver.py,1.3,1.4
Tim Peters
tim_one@users.sourceforge.net
Mon, 17 Sep 2001 16:56:22 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv18154/python/Lib/test
Modified Files:
test_socketserver.py
Log Message:
Rework akin to test_threaded_import, so that this can run under regrtest.
Also raise TestSkipped (intead of appearing to fail) if the import lock
is held.
Index: test_socketserver.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socketserver.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_socketserver.py 2001/07/13 17:27:57 1.3
--- test_socketserver.py 2001/09/17 23:56:20 1.4
***************
*** 1,10 ****
# Test suite for SocketServer.py
- # XXX This must be run manually -- somehow the I/O redirection of the
- # regression test breaks the test.
-
from test_support import verbose, verify, TESTFN, TestSkipped
- if not verbose:
- raise TestSkipped, "test_socketserver can only be run manually"
from SocketServer import *
--- 1,5 ----
***************
*** 154,158 ****
##testloop(socket.AF_UNIX, dgramservers, MyDatagramHandler, testdgram)
! def main():
try:
testall()
--- 149,158 ----
##testloop(socket.AF_UNIX, dgramservers, MyDatagramHandler, testdgram)
! def test_main():
! import imp
! if imp.lock_held():
! # If the import lock is held, the threads will hang.
! raise TestSkipped("can't run when import lock is held")
!
try:
testall()
***************
*** 160,162 ****
cleanup()
! main()
--- 160,163 ----
cleanup()
! if __name__ == "__main__":
! test_main()