From 68a47ade46e6f6fb4235e1355b6a535e9c422f29 Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Wed, 26 Aug 2015 02:34:21 +0500 Subject: [PATCH] PY3 port test_logformatter --- tests/py3-ignores.txt | 1 - tests/test_logformatter.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txt index 4d7fdc430..f380e6679 100644 --- a/tests/py3-ignores.txt +++ b/tests/py3-ignores.txt @@ -20,7 +20,6 @@ tests/test_downloadermiddleware_retry.py tests/test_downloadermiddleware_stats.py tests/test_downloadermiddleware_useragent.py tests/test_engine.py -tests/test_logformatter.py tests/test_mail.py tests/test_pipeline_files.py tests/test_pipeline_images.py diff --git a/tests/test_logformatter.py b/tests/test_logformatter.py index ec42ef8ab..50e9662c6 100644 --- a/tests/test_logformatter.py +++ b/tests/test_logformatter.py @@ -1,4 +1,5 @@ import unittest +import six from scrapy.spiders import Spider from 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__":