Skip to content

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

fix error reporting in test: we can fail in process_request too, so result should always be defined

Konstantin Lopuhin8330776c2193
diff --git a/tests/test_downloadermiddleware_httpcache.py b/tests/test_downloadermiddleware_httpcache.py
index 4e0c72304..12b69860a 100644
--- a/tests/test_downloadermiddleware_httpcache.py
+++ b/tests/test_downloadermiddleware_httpcache.py
@@ -257,6 +257,7 @@ class RFC2616PolicyTest(DefaultStorageTest):
policy_class = 'scrapy.extensions.httpcache.RFC2616Policy'
def _process_requestresponse(self, mw, request, response):
+ result = None
try:
result = mw.process_request(request, self.spider)
if result: