MCPcopy
hub / github.com/scrapy/scrapy / test_exception_async_callback

Method test_exception_async_callback

tests/test_engine.py:760–770  ·  view source on GitHub ↗
(
        self, crawler: Crawler, caplog: pytest.LogCaptureFixture
    )

Source from the content-addressed store, hash-verified

758
759 @coroutine_test
760 async def test_exception_async_callback(
761 self, crawler: Crawler, caplog: pytest.LogCaptureFixture
762 ) -> None:
763 async def cb(_):
764 raise ValueError
765
766 engine = ExecutionEngine(crawler, cb)
767 crawler.engine = engine
768 await engine.open_spider_async()
769 await engine.close_spider_async()
770 assert "Error running spider_closed_callback" in caplog.text

Callers

nothing calls this directly

Calls 3

open_spider_asyncMethod · 0.95
close_spider_asyncMethod · 0.95
ExecutionEngineClass · 0.90

Tested by

no test coverage detected