Scrapy, a fast high-level web crawling & scraping framework for Python.
PY3: port scrapy/utils/gz.py
Daniel Grañac564334d00fa
diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txtindex 868264b85..5905eaa55 100644--- a/tests/py3-ignores.txt+++ b/tests/py3-ignores.txt@@ -64,7 +64,6 @@ tests/test_squeue.pytests/test_stats.pytests/test_toplevel.pytests/test_utils_defer.py-tests/test_utils_gz.pytests/test_utils_httpobj.pytests/test_utils_iterators.pytests/test_utils_jsonrpc.pydiff --git a/tests/test_utils_gz.py b/tests/test_utils_gz.pyindex 7250a870e..94e7b71be 100644--- a/tests/test_utils_gz.py+++ b/tests/test_utils_gz.py@@ -1,11 +1,12 @@import unittestfrom os.path import join-from tests import tests_datadirfrom scrapy.utils.gz import gunzip+from tests import tests_datadirSAMPLEDIR = join(tests_datadir, 'compressed')+class GzTest(unittest.TestCase):def test_gunzip_basic(self):@@ -16,7 +17,7 @@ class GzTest(unittest.TestCase):def test_gunzip_truncated(self):with open(join(SAMPLEDIR, 'truncated-crc-error.gz'), 'rb') as f:text = gunzip(f.read())- assert text.endswith('</html')+ assert text.endswith(b'</html')def test_gunzip_no_gzip_file_raises(self):with open(join(SAMPLEDIR, 'feed-sample1.xml'), 'rb') as f:@@ -25,4 +26,4 @@ class GzTest(unittest.TestCase):def test_gunzip_truncated_short(self):with open(join(SAMPLEDIR, 'truncated-crc-error-short.gz'), 'rb') as f:text = gunzip(f.read())- assert text.endswith('</html>')+ assert text.endswith(b'</html>')