summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-12-03 11:29:45 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-12-03 11:29:45 (GMT)
commitef2d8a597cf859b9d945dfb1c491a214fb1381df (patch)
treedc6e0ae643adb4d54ecba2e1cf1587b9d19c84df /Lib/test/test_logging.py
parent51af82cc398ed5d68fa2aae09c1baf7ff9fe11e3 (diff)
parent827f5d35e592c21e4bb82afb702c6496cf77c2ad (diff)
downloadcpython-ef2d8a597cf859b9d945dfb1c491a214fb1381df.zip
cpython-ef2d8a597cf859b9d945dfb1c491a214fb1381df.tar.gz
cpython-ef2d8a597cf859b9d945dfb1c491a214fb1381df.tar.bz2
Closes #19665: Merged fi from 3.3.
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index ffd0c8b..5702c1c 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -912,19 +912,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)