summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2013-11-18 21:10:04 (GMT)
committerGregory P. Smith <greg@krypto.org>2013-11-18 21:10:04 (GMT)
commit30d8e167ff37f25f63cced74cac970ca409cbd99 (patch)
tree2905c57e63a09acaca2868522617aa120f10acc2
parent162307fa3558341b82570a42b2f023b9623df822 (diff)
downloadcpython-30d8e167ff37f25f63cced74cac970ca409cbd99.zip
cpython-30d8e167ff37f25f63cced74cac970ca409cbd99.tar.gz
cpython-30d8e167ff37f25f63cced74cac970ca409cbd99.tar.bz2
Cleanup this test's modification of os.environ in teardown (this already
exists in 3.4 but apparently wasn't done for 3.3).
-rw-r--r--Lib/test/test_urllib2_localnet.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
index b1aa158..9112e50 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -353,12 +353,15 @@ class TestUrlopen(unittest.TestCase):
def setUp(self):
super(TestUrlopen, self).setUp()
# Ignore proxies for localhost tests.
+ self.old_environ = os.environ.copy()
os.environ['NO_PROXY'] = '*'
self.server = None
def tearDown(self):
if self.server is not None:
self.server.stop()
+ os.environ.clear()
+ os.environ.update(self.old_environ)
super(TestUrlopen, self).tearDown()
def urlopen(self, url, data=None, **kwargs):