1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-24 16:03:49 +00:00

fix engine tests - this callback (spider_closed_callback) should accept one argument, but the error was hidden on py2

This commit is contained in:
Konstantin Lopuhin 2016-01-19 10:07:00 +03:00
parent a32b59ac75
commit 0b08b4bfcf

View File

@ -238,12 +238,12 @@ class EngineTest(unittest.TestCase):
@defer.inlineCallbacks
def test_close_downloader(self):
e = ExecutionEngine(get_crawler(TestSpider), lambda: None)
e = ExecutionEngine(get_crawler(TestSpider), lambda _: None)
yield e.close()
@defer.inlineCallbacks
def test_close_spiders_downloader(self):
e = ExecutionEngine(get_crawler(TestSpider), lambda: None)
e = ExecutionEngine(get_crawler(TestSpider), lambda _: None)
yield e.open_spider(TestSpider(), [])
self.assertEqual(len(e.open_spiders), 1)
yield e.close()
@ -251,7 +251,7 @@ class EngineTest(unittest.TestCase):
@defer.inlineCallbacks
def test_close_engine_spiders_downloader(self):
e = ExecutionEngine(get_crawler(TestSpider), lambda: None)
e = ExecutionEngine(get_crawler(TestSpider), lambda _: None)
yield e.open_spider(TestSpider(), [])
e.start()
self.assertTrue(e.running)