Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions 15 Lib/test/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ def test_path_objects(self):

@unittest.skipIf(os.name == 'nt', 'WatchedFileHandler not appropriate for Windows.')
@unittest.skipUnless(threading, 'Threading required for this test.')
@support.reap_threads
def test_race(self):
# Issue #14632 refers.
def remove_loop(fname, tries):
Expand Down Expand Up @@ -776,7 +777,10 @@ def stop(self, timeout=None):
"""
self.close()
self._thread.join(timeout)
alive = self._thread.is_alive()
self._thread = None
if alive:
self.fail("join() timed out")

class ControlMixin(object):
"""
Expand Down Expand Up @@ -827,7 +831,10 @@ def stop(self, timeout=None):
self.shutdown()
if self._thread is not None:
self._thread.join(timeout)
alive = self._thread.is_alive()
self._thread = None
if alive:
self.fail("join() timed out")
self.server_close()
self.ready.clear()

Expand Down Expand Up @@ -962,6 +969,8 @@ class TestUnixDatagramServer(TestUDPServer):
@unittest.skipUnless(threading, 'Threading required for this test.')
class SMTPHandlerTest(BaseTest):
TIMEOUT = 8.0

@support.reap_threads
def test_basic(self):
sockmap = {}
server = TestSMTPServer((support.HOST, 0), self.process_message, 0.001,
Expand Down Expand Up @@ -1752,6 +1761,7 @@ def handle_request(self, request):
request.end_headers()
self.handled.set()

@support.reap_threads
def test_output(self):
# The log message sent to the HTTPHandler is properly received.
logger = logging.getLogger("http")
Expand Down Expand Up @@ -2863,8 +2873,11 @@ def setup_via_listener(self, text, verify=None):
t.ready.wait(2.0)
logging.config.stopListening()
t.join(2.0)
if t.is_alive():
self.fail("join() timed out")

@unittest.skipUnless(threading, 'Threading required for this test.')
@support.reap_threads
def test_listen_config_10_ok(self):
with support.captured_stdout() as output:
self.setup_via_listener(json.dumps(self.config10))
Expand All @@ -2885,6 +2898,7 @@ def test_listen_config_10_ok(self):
], stream=output)

@unittest.skipUnless(threading, 'Threading required for this test.')
@support.reap_threads
def test_listen_config_1_ok(self):
with support.captured_stdout() as output:
self.setup_via_listener(textwrap.dedent(ConfigFileTest.config1))
Expand All @@ -2900,6 +2914,7 @@ def test_listen_config_1_ok(self):
self.assert_log_lines([])

@unittest.skipUnless(threading, 'Threading required for this test.')
@support.reap_threads
def test_listen_verify(self):

def verify_fail(stuff):
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.