summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r--Lib/test/test_urllib.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index 82f1d9d..bc6e74c 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -232,17 +232,12 @@ class ProxyTests(unittest.TestCase):
def setUp(self):
# Records changes to env vars
- self.env = os_helper.EnvironmentVarGuard()
+ self.env = self.enterContext(os_helper.EnvironmentVarGuard())
# Delete all proxy related env vars
for k in list(os.environ):
if 'proxy' in k.lower():
self.env.unset(k)
- def tearDown(self):
- # Restore all proxy related env vars
- self.env.__exit__()
- del self.env
-
def test_getproxies_environment_keep_no_proxies(self):
self.env.set('NO_PROXY', 'localhost')
proxies = urllib.request.getproxies_environment()