summaryrefslogtreecommitdiff
path: root/Lib/test/test_urllib2net.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_urllib2net.py')
-rw-r--r--Lib/test/test_urllib2net.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
index 0f43d71ea6..040a2ce276 100644
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -82,6 +82,9 @@ class AuthTests(unittest.TestCase):
class CloseSocketTest(unittest.TestCase):
def test_close(self):
+ # clear _opener global variable
+ self.addCleanup(urllib.request.urlcleanup)
+
# calling .close() on urllib2's response objects should close the
# underlying socket
url = support.TEST_HTTP_URL
@@ -257,6 +260,10 @@ class OtherNetworkTests(unittest.TestCase):
class TimeoutTest(unittest.TestCase):
+ def setUp(self):
+ # clear _opener global variable
+ self.addCleanup(urllib.request.urlcleanup)
+
def test_http_basic(self):
self.assertIsNone(socket.getdefaulttimeout())
url = support.TEST_HTTP_URL