mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Updated test_logging so that errors don't occur in the absence of threading.
This commit is contained in:
parent
f6cdffeb78
commit
cb2c4fe649
1 changed files with 15 additions and 10 deletions
|
@ -78,7 +78,6 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class BaseTest(unittest.TestCase):
|
class BaseTest(unittest.TestCase):
|
||||||
|
|
||||||
"""Base class for logging tests."""
|
"""Base class for logging tests."""
|
||||||
|
@ -1366,6 +1365,7 @@ class SocketHandlerTest(BaseTest):
|
||||||
|
|
||||||
"""Test for SocketHandler objects."""
|
"""Test for SocketHandler objects."""
|
||||||
|
|
||||||
|
if threading:
|
||||||
server_class = TestTCPServer
|
server_class = TestTCPServer
|
||||||
address = ('localhost', 0)
|
address = ('localhost', 0)
|
||||||
|
|
||||||
|
@ -1450,6 +1450,7 @@ class UnixSocketHandlerTest(SocketHandlerTest):
|
||||||
|
|
||||||
"""Test for SocketHandler with unix sockets."""
|
"""Test for SocketHandler with unix sockets."""
|
||||||
|
|
||||||
|
if threading:
|
||||||
server_class = TestUnixStreamServer
|
server_class = TestUnixStreamServer
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -1466,6 +1467,7 @@ class DatagramHandlerTest(BaseTest):
|
||||||
|
|
||||||
"""Test for DatagramHandler."""
|
"""Test for DatagramHandler."""
|
||||||
|
|
||||||
|
if threading:
|
||||||
server_class = TestUDPServer
|
server_class = TestUDPServer
|
||||||
address = ('localhost', 0)
|
address = ('localhost', 0)
|
||||||
|
|
||||||
|
@ -1520,6 +1522,7 @@ class UnixDatagramHandlerTest(DatagramHandlerTest):
|
||||||
|
|
||||||
"""Test for DatagramHandler using Unix sockets."""
|
"""Test for DatagramHandler using Unix sockets."""
|
||||||
|
|
||||||
|
if threading:
|
||||||
server_class = TestUnixDatagramServer
|
server_class = TestUnixDatagramServer
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -1536,6 +1539,7 @@ class SysLogHandlerTest(BaseTest):
|
||||||
|
|
||||||
"""Test for SysLogHandler using UDP."""
|
"""Test for SysLogHandler using UDP."""
|
||||||
|
|
||||||
|
if threading:
|
||||||
server_class = TestUDPServer
|
server_class = TestUDPServer
|
||||||
address = ('localhost', 0)
|
address = ('localhost', 0)
|
||||||
|
|
||||||
|
@ -1593,6 +1597,7 @@ class UnixSysLogHandlerTest(SysLogHandlerTest):
|
||||||
|
|
||||||
"""Test for SysLogHandler with Unix sockets."""
|
"""Test for SysLogHandler with Unix sockets."""
|
||||||
|
|
||||||
|
if threading:
|
||||||
server_class = TestUnixDatagramServer
|
server_class = TestUnixDatagramServer
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue