(Hopefully) suppress transient refleaks in test_httpservers.

This commit is contained in:
Antoine Pitrou 2009-10-27 18:50:52 +00:00
parent f829d1f551
commit 85bd5879b2
1 changed files with 2 additions and 0 deletions

View 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)