From: Antoine Pitrou Date: Sat, 21 Dec 2013 23:44:01 +0000 (+0100) Subject: Fix urllib.request.build_opener mocking in test_distutils (should fix some random... X-Git-Tag: v3.4.0b2~134^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6783487757be881e4ea6e0c9bae36374da7014c2;p=python Fix urllib.request.build_opener mocking in test_distutils (should fix some random buildbot failures) --- diff --git a/Lib/distutils/tests/test_register.py b/Lib/distutils/tests/test_register.py index 8bcc85851a..6180133994 100644 --- a/Lib/distutils/tests/test_register.py +++ b/Lib/distutils/tests/test_register.py @@ -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()