]> granicus.if.org Git - python/commitdiff
(Hopefully) suppress transient refleaks in test_httpservers.
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 27 Oct 2009 18:50:52 +0000 (18:50 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 27 Oct 2009 18:50:52 +0000 (18:50 +0000)
Lib/test/test_httpservers.py

index 3ec014018bc3ecb3a06082b6a0957baf194a6f0e..87d558844cde8ff5fa36bd64581317421b4e61bf 100644 (file)
@@ -50,6 +50,7 @@ class TestServerThread(threading.Thread):
 
 class BaseTestCase(unittest.TestCase):
     def setUp(self):
+        self._threads = test_support.threading_setup()
         os.environ = test_support.EnvironmentVarGuard()
         self.lock = threading.Lock()
         self.thread = TestServerThread(self, self.request_handler)
@@ -60,6 +61,7 @@ class BaseTestCase(unittest.TestCase):
         self.lock.release()
         self.thread.stop()
         os.environ.__exit__()
+        test_support.threading_cleanup(*self._threads)
 
     def request(self, uri, method='GET', body=None, headers={}):
         self.connection = httplib.HTTPConnection('localhost', self.PORT)