MCPcopy
hub / github.com/scrapy/scrapy / test_exception_stats

Method test_exception_stats

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

Source from the content-addressed store, hash-verified

736
737 @coroutine_test
738 async def test_exception_stats(
739 self, crawler: Crawler, caplog: pytest.LogCaptureFixture
740 ) -> None:
741 engine = ExecutionEngine(crawler, lambda _: None)
742 crawler.engine = engine
743 await engine.open_spider_async()
744 assert isinstance(crawler.stats, MemoryStatsCollector)
745 del crawler.stats.spider_stats
746 await engine.close_spider_async()
747 assert "Stats close failure" in caplog.text
748
749 @coroutine_test
750 async def test_exception_callback(

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