Fix transient refleaks in test_urllib2_localnet.

This commit is contained in:
Antoine Pitrou 2009-10-27 20:14:04 +00:00
parent bb0bb30acc
commit fce3207b53
1 changed files with 10 additions and 2 deletions

View File

@ -220,7 +220,15 @@ class FakeProxyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
# Test cases
class ProxyAuthTests(unittest.TestCase):
class BaseTestCase(unittest.TestCase):
def setUp(self):
self._threads = test_support.threading_setup()
def tearDown(self):
test_support.threading_cleanup(*self._threads)
class ProxyAuthTests(BaseTestCase):
URL = "http://localhost"
USER = "tester"
@ -327,7 +335,7 @@ def GetRequestHandler(responses):
return FakeHTTPRequestHandler
class TestUrlopen(unittest.TestCase):
class TestUrlopen(BaseTestCase):
"""Tests urllib2.urlopen using the network.
These tests are not exhaustive. Assuming that testing using files does a