Scrapy, a fast high-level web crawling & scraping framework for Python.
PY3 port test_logformatter
Mikhail Korobov68a47ade46e6
diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txtindex 4d7fdc430..f380e6679 100644--- a/tests/py3-ignores.txt+++ b/tests/py3-ignores.txt@@ -20,7 +20,6 @@ tests/test_downloadermiddleware_retry.pytests/test_downloadermiddleware_stats.pytests/test_downloadermiddleware_useragent.pytests/test_engine.py-tests/test_logformatter.pytests/test_mail.pytests/test_pipeline_files.pytests/test_pipeline_images.pydiff --git a/tests/test_logformatter.py b/tests/test_logformatter.pyindex ec42ef8ab..50e9662c6 100644--- a/tests/test_logformatter.py+++ b/tests/test_logformatter.py@@ -1,4 +1,5 @@import unittest+import sixfrom scrapy.spiders import Spiderfrom scrapy.http import Request, Response@@ -42,7 +43,7 @@ class LoggingContribTest(unittest.TestCase):logkws = self.formatter.dropped(item, exception, response, self.spider)logline = logkws['msg'] % logkws['args']lines = logline.splitlines()- assert all(isinstance(x, unicode) for x in lines)+ assert all(isinstance(x, six.text_type) for x in lines)self.assertEqual(lines, [u"Dropped: \u2018", '{}'])def test_scraped(self):@@ -52,7 +53,7 @@ class LoggingContribTest(unittest.TestCase):logkws = self.formatter.scraped(item, response, self.spider)logline = logkws['msg'] % logkws['args']lines = logline.splitlines()- assert all(isinstance(x, unicode) for x in lines)+ assert all(isinstance(x, six.text_type) for x in lines)self.assertEqual(lines, [u"Scraped from <200 http://www.example.com>", u'name: \xa3'])if __name__ == "__main__":