From: Martin Panter Date: Sat, 22 Oct 2016 03:00:32 +0000 (+0000) Subject: Issue #28435: Avoid no_proxy environment variable interfering with tests X-Git-Tag: v2.7.13rc1~69 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58bd36b9873147a174ae377cc9762fa43d870ef0;p=python Issue #28435: Avoid no_proxy environment variable interfering with tests Patch by Piotr Szczepaniak. --- diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py index 51a95dc437..9199cb9310 100644 --- a/Lib/test/test_urllib2_localnet.py +++ b/Lib/test/test_urllib2_localnet.py @@ -329,6 +329,14 @@ class ProxyAuthTests(BaseTestCase): 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) diff --git a/Misc/ACKS b/Misc/ACKS index 9c805b03e6..6d245cd842 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1361,6 +1361,7 @@ Al Sweigart Thenault Sylvain Péter Szabó John Szakmeister +Piotr Szczepaniak Amir Szekely Arfrever Frehtes Taifersar Arahesis Hideaki Takahashi