MCPcopy
hub / github.com/scrapy/scrapy / test_no_slot

Method test_no_slot

tests/test_engine.py:654–664  ·  view source on GitHub ↗
(self, crawler: Crawler)

Source from the content-addressed store, hash-verified

652
653 @coroutine_test
654 async def test_no_slot(self, crawler: Crawler) -> None:
655 engine = ExecutionEngine(crawler, lambda _: None)
656 crawler.engine = engine
657 await engine.open_spider_async()
658 slot = engine._slot
659 engine._slot = None
660 with pytest.raises(RuntimeError, match="Engine slot not assigned"):
661 await engine.close_spider_async()
662 # close it correctly
663 engine._slot = slot
664 await engine.close_spider_async()
665
666 @coroutine_test
667 async def test_no_spider(self, crawler: Crawler) -> None:

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