Skip to content

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

Minor adjustment to the test case in tests/test_downloadermiddleware_httpcompression.py

P. Chen6032a9a31065
diff --git a/tests/test_downloadermiddleware_httpcompression.py b/tests/test_downloadermiddleware_httpcompression.py
index 63a69f7af..7e9f9cc5d 100644
--- a/tests/test_downloadermiddleware_httpcompression.py
+++ b/tests/test_downloadermiddleware_httpcompression.py
@@ -101,7 +101,8 @@ class HttpCompressionTest(TestCase):
newresponse = self.mw.process_response(request, response, self.spider)
if raw_content is None:
raw_content = newresponse.body
- assert raw_content == newresponse.body
+ else:
+ assert raw_content == newresponse.body
assert newresponse is not response
assert newresponse.body.startswith(b"<!DOCTYPE")
assert 'Content-Encoding' not in newresponse.headers