Scrapy, a fast high-level web crawling & scraping framework for Python.
PY3 fix test middleware
nyov8ab1648a3630
diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txtindex 4dfab4a9a..a6c92d508 100644--- a/tests/py3-ignores.txt+++ b/tests/py3-ignores.txt@@ -28,7 +28,6 @@ tests/test_engine.pytests/test_http_cookies.pytests/test_logformatter.pytests/test_mail.py-tests/test_middleware.pytests/test_pipeline_files.pytests/test_pipeline_images.pytests/test_pipeline_media.pydiff --git a/tests/test_middleware.py b/tests/test_middleware.pyindex 48131462c..b6d885330 100644--- a/tests/test_middleware.py+++ b/tests/test_middleware.py@@ -3,6 +3,7 @@ from twisted.trial import unittestfrom scrapy.settings import Settingsfrom scrapy.exceptions import NotConfiguredfrom scrapy.middleware import MiddlewareManager+import sixclass M1(object):@@ -65,12 +66,20 @@ class MiddlewareManagerTest(unittest.TestCase):def test_methods(self):mwman = TestMiddlewareManager(M1(), M2(), M3())- self.assertEqual([x.im_class for x in mwman.methods['open_spider']],- [M1, M2])- self.assertEqual([x.im_class for x in mwman.methods['close_spider']],- [M2, M1])- self.assertEqual([x.im_class for x in mwman.methods['process']],- [M1, M3])+ if six.PY2:+ self.assertEqual([x.im_class for x in mwman.methods['open_spider']],+ [M1, M2])+ self.assertEqual([x.im_class for x in mwman.methods['close_spider']],+ [M2, M1])+ self.assertEqual([x.im_class for x in mwman.methods['process']],+ [M1, M3])+ else:+ self.assertEqual([x.__self__.__class__ for x in mwman.methods['open_spider']],+ [M1, M2])+ self.assertEqual([x.__self__.__class__ for x in mwman.methods['close_spider']],+ [M2, M1])+ self.assertEqual([x.__self__.__class__ for x in mwman.methods['process']],+ [M1, M3])def test_enabled(self):m1, m2, m3 = M1(), M2(), M3()