mirror of
https://github.com/python/cpython.git
synced 2025-10-12 01:43:12 +00:00
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.
This commit is contained in:
parent
9ae505041f
commit
1fa6915427
1 changed files with 2 additions and 9 deletions
|
@ -940,6 +940,7 @@ class BasicTest(TestCase):
|
||||||
|
|
||||||
thread = threading.Thread(target=run_server)
|
thread = threading.Thread(target=run_server)
|
||||||
thread.start()
|
thread.start()
|
||||||
|
self.addCleanup(thread.join, float(1))
|
||||||
conn = client.HTTPConnection(*serv.getsockname())
|
conn = client.HTTPConnection(*serv.getsockname())
|
||||||
conn.request("CONNECT", "dummy:1234")
|
conn.request("CONNECT", "dummy:1234")
|
||||||
response = conn.getresponse()
|
response = conn.getresponse()
|
||||||
|
@ -1711,13 +1712,5 @@ class TunnelTests(TestCase):
|
||||||
self.assertIn('header: {}'.format(expected_header), lines)
|
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__':
|
if __name__ == '__main__':
|
||||||
test_main()
|
test_main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue