[Python-checkins] cpython (3.3): Fix urllib.request.build_opener mocking in test_distutils (should fix some

antoine.pitrou python-checkins at python.org
Sun Dec 22 00:44:42 CET 2013


http://hg.python.org/cpython/rev/927946b62d6b
changeset: 88120:927946b62d6b
branch: 3.3
parent: 88118:cffed58b1bbd
user: Antoine Pitrou <solipsis at pitrou.net>
date: Sun Dec 22 00:44:01 2013 +0100
summary:
 Fix urllib.request.build_opener mocking in test_distutils (should fix some random buildbot failures)
files:
 Lib/distutils/tests/test_register.py | 2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Lib/distutils/tests/test_register.py b/Lib/distutils/tests/test_register.py
--- a/Lib/distutils/tests/test_register.py
+++ b/Lib/distutils/tests/test_register.py
@@ -81,11 +81,13 @@
 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()
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /