mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-24 20:43:50 +00:00
Unset environment proxies for tests
because urllib doesn't handle $no_proxy correctly and the unittest webserver is always local.
This commit is contained in:
parent
d706310d8b
commit
4f56c6c79b
@ -6,6 +6,13 @@ see http://doc.scrapy.org/en/latest/contributing.html#running-tests
|
||||
|
||||
import os
|
||||
|
||||
# ignore system-wide proxies for tests
|
||||
# which would send requests to a totally unsuspecting server
|
||||
# (e.g. because urllib does not fully understand the proxy spec)
|
||||
os.environ['http_proxy'] = ''
|
||||
os.environ['https_proxy'] = ''
|
||||
os.environ['ftp_proxy'] = ''
|
||||
|
||||
try:
|
||||
import unittest.mock as mock
|
||||
except ImportError:
|
||||
|
Loading…
x
Reference in New Issue
Block a user