diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-08-23 09:01:43 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-08-23 09:01:43 +0000 |
commit | 1fa69154270c3ad41e8abfbc399128f31c41a63a (patch) | |
tree | a9ac9a001f1d65fedb6a2393b08dde7a80fc0311 /Lib/test/test_httplib.py | |
parent | 9ae505041fea29dfc52c86968db48e8c78500ecc (diff) | |
download | cpython-git-1fa69154270c3ad41e8abfbc399128f31c41a63a.tar.gz |
Issue #27787: Remove test_main() and hard-coded list of test classes
The @reap_threads decorator made the test wait (for up to 1 s) until
background threads have finished. Calling join() with a timeout should be
equivalent.
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r-- | Lib/test/test_httplib.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index f45e352d6a..5c500cbc46 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -940,6 +940,7 @@ class BasicTest(TestCase): thread = threading.Thread(target=run_server) thread.start() + self.addCleanup(thread.join, float(1)) conn = client.HTTPConnection(*serv.getsockname()) conn.request("CONNECT", "dummy:1234") response = conn.getresponse() @@ -953,7 +954,7 @@ class BasicTest(TestCase): finally: response.close() conn.close() - thread.join() + thread.join() self.assertEqual(result, b"proxied data\n") class ExtendedReadTest(TestCase): @@ -1711,13 +1712,5 @@ class TunnelTests(TestCase): self.assertIn('header: {}'.format(expected_header), lines) -@support.reap_threads -def test_main(verbose=None): - support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest, - PersistenceTest, - HTTPSTest, RequestBodyTest, SourceAddressTest, - HTTPResponseTest, ExtendedReadTest, - ExtendedReadTestChunked, TunnelTests) - if __name__ == '__main__': test_main() |