Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Lib/test/test_urllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ def test_getproxies_environment_prefer_lowercase(self):
class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin):
"""Test urlopen() opening a fake http connection."""

def setUp(self):
# Don't use proxies from the environment or the system settings,
# and don't reuse an opener created by an earlier test.
self.enterContext(
support.swap_attr(urllib.request, 'getproxies', lambda: {}))
urllib.request.urlcleanup()
self.addCleanup(urllib.request.urlcleanup)

def check_read(self, ver):
self.fakehttp(b"HTTP/" + ver + b" 200 OK\r\n\r\nHello!")
try:
Expand Down
Loading