diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-12-03 11:28:55 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-12-03 11:28:55 (GMT) |
commit | 827f5d35e592c21e4bb82afb702c6496cf77c2ad (patch) | |
tree | 8df144057a2ad038919ae62ef3f1f6ff538c5cff /Lib/test/test_logging.py | |
parent | 7601a1e56f8296d7422893fff59ee6e676200622 (diff) | |
download | cpython-827f5d35e592c21e4bb82afb702c6496cf77c2ad.zip cpython-827f5d35e592c21e4bb82afb702c6496cf77c2ad.tar.gz cpython-827f5d35e592c21e4bb82afb702c6496cf77c2ad.tar.bz2 |
Issue #19665: Increased timeout for SMTPHandler test.
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r-- | Lib/test/test_logging.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index ae4ca18..8c6e6b8 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -959,19 +959,21 @@ if threading: @unittest.skipUnless(threading, 'Threading required for this test.') class SMTPHandlerTest(BaseTest): + TIMEOUT = 8.0 def test_basic(self): sockmap = {} server = TestSMTPServer(('localhost', 0), self.process_message, 0.001, sockmap) server.start() addr = ('localhost', server.port) - h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log', timeout=5.0) + h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log', + timeout=self.TIMEOUT) self.assertEqual(h.toaddrs, ['you']) self.messages = [] r = logging.makeLogRecord({'msg': 'Hello'}) self.handled = threading.Event() h.handle(r) - self.handled.wait(5.0) # 14314: don't wait forever + self.handled.wait(self.TIMEOUT) # 14314: don't wait forever server.stop() self.assertTrue(self.handled.is_set()) self.assertEqual(len(self.messages), 1) |