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:
nyov 2015-07-11 11:27:33 +00:00
parent d706310d8b
commit 4f56c6c79b
1 changed files with 7 additions and 0 deletions

View File

@ -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: