]> granicus.if.org Git - python/commitdiff
Fix urllib.request.build_opener mocking in test_distutils (should fix some random...
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 21 Dec 2013 23:44:01 +0000 (00:44 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 21 Dec 2013 23:44:01 +0000 (00:44 +0100)
Lib/distutils/tests/test_register.py

index 8bcc85851a78cac33859f9b661065104ec244fb5..6180133994f8e583d12a5bdc4497e9cf7b9c632a 100644 (file)
@@ -81,11 +81,13 @@ class RegisterTestCase(PyPIRCCommandTestCase):
         def _getpass(prompt):
             return 'password'
         getpass.getpass = _getpass
+        urllib.request._opener = None
         self.old_opener = urllib.request.build_opener
         self.conn = urllib.request.build_opener = FakeOpener()
 
     def tearDown(self):
         getpass.getpass = self._old_getpass
+        urllib.request._opener = None
         urllib.request.build_opener = self.old_opener
         super(RegisterTestCase, self).tearDown()