Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0ee09691
Commit
0ee09691
authored
Jan 03, 2009
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_urllib would set environment variable NO_PROXY without removing it afterwards.
parent
45c1f289
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Lib/test/test_urllib.py
Lib/test/test_urllib.py
+8
-4
No files found.
Lib/test/test_urllib.py
View file @
0ee09691
...
@@ -130,10 +130,14 @@ class ProxyTests(unittest.TestCase):
...
@@ -130,10 +130,14 @@ class ProxyTests(unittest.TestCase):
os
.
environ
[
k
]
=
v
os
.
environ
[
k
]
=
v
def
test_getproxies_environment_keep_no_proxies
(
self
):
def
test_getproxies_environment_keep_no_proxies
(
self
):
try
:
os
.
environ
[
'NO_PROXY'
]
=
'localhost'
os
.
environ
[
'NO_PROXY'
]
=
'localhost'
proxies
=
urllib
.
request
.
getproxies_environment
()
proxies
=
urllib
.
request
.
getproxies_environment
()
# getproxies_environment use lowered case truncated (no '_proxy') keys
# getproxies_environment use lowered case truncated (no '_proxy') keys
self
.
assertEquals
(
'localhost'
,
proxies
[
'no'
])
self
.
assertEquals
(
'localhost'
,
proxies
[
'no'
])
finally
:
# The old value will be restored by tearDown, if applicable.
del
os
.
environ
[
'NO_PROXY'
]
class
urlopen_HttpTests
(
unittest
.
TestCase
):
class
urlopen_HttpTests
(
unittest
.
TestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment