diff options
author | Victor Stinner <vstinner@python.org> | 2019-12-10 19:41:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-10 19:41:23 (GMT) |
commit | bbc8b7965bb9f46763c96878326966f4231c7d39 (patch) | |
tree | f9dfe1e3637a9c2805e8757a5abc75bdd0e47352 /Lib/test/test_asynchat.py | |
parent | 07871b256c76ca561554d1f82b430fc64a5c7ee0 (diff) | |
download | cpython-bbc8b7965bb9f46763c96878326966f4231c7d39.zip cpython-bbc8b7965bb9f46763c96878326966f4231c7d39.tar.gz cpython-bbc8b7965bb9f46763c96878326966f4231c7d39.tar.bz2 |
bpo-38614: Use default join_thread() timeout in tests (GH-17559)
Tests no longer pass a timeout value to join_thread() of
test.support: use the default join_thread() timeout instead
(SHORT_TIMEOUT constant of test.support).
Diffstat (limited to 'Lib/test/test_asynchat.py')
-rw-r--r-- | Lib/test/test_asynchat.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py index 74041ed..ce85057 100644 --- a/Lib/test/test_asynchat.py +++ b/Lib/test/test_asynchat.py @@ -14,7 +14,6 @@ import unittest.mock HOST = support.HOST SERVER_QUIT = b'QUIT\n' -TIMEOUT = 3.0 class echo_server(threading.Thread): @@ -122,7 +121,7 @@ class TestAsynchat(unittest.TestCase): c.push(b"I'm not dead yet!" + term) c.push(SERVER_QUIT) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) - support.join_thread(s, timeout=TIMEOUT) + support.join_thread(s) self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"]) @@ -153,7 +152,7 @@ class TestAsynchat(unittest.TestCase): c.push(data) c.push(SERVER_QUIT) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) - support.join_thread(s, timeout=TIMEOUT) + support.join_thread(s) self.assertEqual(c.contents, [data[:termlen]]) @@ -173,7 +172,7 @@ class TestAsynchat(unittest.TestCase): c.push(data) c.push(SERVER_QUIT) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) - support.join_thread(s, timeout=TIMEOUT) + support.join_thread(s) self.assertEqual(c.contents, []) self.assertEqual(c.buffer, data) @@ -185,7 +184,7 @@ class TestAsynchat(unittest.TestCase): p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) c.push_with_producer(p) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) - support.join_thread(s, timeout=TIMEOUT) + support.join_thread(s) self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"]) @@ -195,7 +194,7 @@ class TestAsynchat(unittest.TestCase): data = b"hello world\nI'm not dead yet!\n" c.push_with_producer(data+SERVER_QUIT) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) - support.join_thread(s, timeout=TIMEOUT) + support.join_thread(s) self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"]) @@ -206,7 +205,7 @@ class TestAsynchat(unittest.TestCase): c.push(b"hello world\n\nI'm not dead yet!\n") c.push(SERVER_QUIT) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) - support.join_thread(s, timeout=TIMEOUT) + support.join_thread(s) self.assertEqual(c.contents, [b"hello world", b"", b"I'm not dead yet!"]) @@ -225,7 +224,7 @@ class TestAsynchat(unittest.TestCase): # where the server echoes all of its data before we can check that it # got any down below. s.start_resend_event.set() - support.join_thread(s, timeout=TIMEOUT) + support.join_thread(s) self.assertEqual(c.contents, []) # the server might have been able to send a byte or two back, but this @@ -246,7 +245,7 @@ class TestAsynchat(unittest.TestCase): self.assertRaises(TypeError, c.push, 'unicode') c.push(SERVER_QUIT) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) - support.join_thread(s, timeout=TIMEOUT) + support.join_thread(s) self.assertEqual(c.contents, [b'bytes', b'bytes', b'bytes']) |