Skip to content

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

PY3 fix test pipeline media

nyovec8afbc060fd
diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txt
index a6c92d508..96b07ae28 100644
--- a/tests/py3-ignores.txt
+++ b/tests/py3-ignores.txt
@@ -30,7 +30,6 @@ tests/test_logformatter.py
tests/test_mail.py
tests/test_pipeline_files.py
tests/test_pipeline_images.py
-tests/test_pipeline_media.py
tests/test_proxy_connect.py
tests/test_responsetypes.py
tests/test_selector_csstranslator.py
diff --git a/tests/test_pipeline_files.py b/tests/test_pipeline_files.py
index b12f41174..ac0438eba 100644
--- a/tests/test_pipeline_files.py
+++ b/tests/test_pipeline_files.py
@@ -192,7 +192,7 @@ def _create_item_with_files(*files):
def _prepare_request_object(item_url):
return Request(
item_url,
- meta={'response': Response(item_url, status=200, body='data')})
+ meta={'response': Response(item_url, status=200, body=b'data')})
if __name__ == "__main__":
diff --git a/tests/test_pipeline_media.py b/tests/test_pipeline_media.py
index fd8b28ce1..f30b4fea3 100644
--- a/tests/test_pipeline_media.py
+++ b/tests/test_pipeline_media.py
@@ -44,7 +44,7 @@ class BaseMediaPipelineTestCase(unittest.TestCase):
def test_default_media_downloaded(self):
request = Request('http://url')
- response = Response('http://url', body='')
+ response = Response('http://url', body=b'')
assert self.pipe.media_downloaded(response, request, self.info) is response
def test_default_media_failed(self):