Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Unset environment proxies for tests

nyov4f56c6c79bd2
diff --git a/tests/__init__.py b/tests/__init__.py
index c6dd45181..d017afad4 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -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: