Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing
TestFifo can be executed without the threading module
This commit is contained in:
parent
be595d336c
commit
09227b9111
|
@ -1,16 +1,18 @@
|
|||
# test asynchat
|
||||
|
||||
import asyncore, asynchat, socket, threading, time
|
||||
import asyncore, asynchat, socket, time
|
||||
import unittest
|
||||
import sys
|
||||
from test import test_support
|
||||
|
||||
# Skip tests if thread module does not exist.
|
||||
test_support.import_module('thread')
|
||||
try:
|
||||
import threading
|
||||
except ImportError:
|
||||
threading = None
|
||||
|
||||
HOST = test_support.HOST
|
||||
SERVER_QUIT = 'QUIT\n'
|
||||
|
||||
if threading:
|
||||
class echo_server(threading.Thread):
|
||||
# parameter to determine the number of bytes passed back to the
|
||||
# client each send
|
||||
|
@ -94,6 +96,7 @@ def start_echo_server():
|
|||
return s, event
|
||||
|
||||
|
||||
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||
class TestAsynchat(unittest.TestCase):
|
||||
usepoll = False
|
||||
|
||||
|
|
Loading…
Reference in New Issue