diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 9a3d2049594..93a6dedb1c0 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -51,6 +51,7 @@ def stop(self): class BaseTestCase(unittest.TestCase): def setUp(self): + self._threads = support.threading_setup() os.environ = support.EnvironmentVarGuard() self.lock = threading.Lock() self.thread = TestServerThread(self, self.request_handler) @@ -61,6 +62,7 @@ def tearDown(self): self.lock.release() self.thread.stop() os.environ.__exit__() + support.threading_cleanup(*self._threads) def request(self, uri, method='GET', body=None, headers={}): self.connection = http.client.HTTPConnection('localhost', self.PORT)