[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #28435: Merge urllib test fixes from 3.5 into 3.6

martin.panter python-checkins at python.org
Fri Oct 21 23:22:48 EDT 2016


https://hg.python.org/cpython/rev/05c3fbaa8fcf
changeset: 104642:05c3fbaa8fcf
branch: 3.6
parent: 104637:02bc01e18b9c
parent: 104641:dc9ad44125de
user: Martin Panter <vadmium+py at gmail.com>
date: Sat Oct 22 03:21:36 2016 +0000
summary:
 Issue #28435: Merge urllib test fixes from 3.5 into 3.6
files:
 Lib/test/test_urllib2_localnet.py | 9 +++++++++
 Misc/ACKS | 1 +
 2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -323,6 +323,14 @@
 
 def setUp(self):
 super(ProxyAuthTests, self).setUp()
+ # Ignore proxy bypass settings in the environment.
+ def restore_environ(old_environ):
+ os.environ.clear()
+ os.environ.update(old_environ)
+ self.addCleanup(restore_environ, os.environ.copy())
+ os.environ['NO_PROXY'] = ''
+ os.environ['no_proxy'] = ''
+
 self.digest_auth_handler = DigestAuthHandler()
 self.digest_auth_handler.set_users({self.USER: self.PASSWD})
 self.digest_auth_handler.set_realm(self.REALM)
@@ -445,6 +453,7 @@
 os.environ.update(old_environ)
 self.addCleanup(restore_environ, os.environ.copy())
 os.environ['NO_PROXY'] = '*'
+ os.environ['no_proxy'] = '*'
 
 def urlopen(self, url, data=None, **kwargs):
 l = []
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1473,6 +1473,7 @@
 Thenault Sylvain
 Péter Szabó
 John Szakmeister
+Piotr Szczepaniak
 Amir Szekely
 Maciej Szulik
 Joel Taddei
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

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