MCPcopy
hub / github.com/scrapy/scrapy / test_start_already_running_exception

Method test_start_already_running_exception

tests/test_engine.py:443–452  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

441
442 @inline_callbacks_test
443 def test_start_already_running_exception(self):
444 crawler = get_crawler(DefaultSpider)
445 crawler.spider = crawler._create_spider()
446 e = ExecutionEngine(crawler, lambda _: None)
447 crawler.engine = e
448 yield deferred_from_coro(e.open_spider_async())
449 _schedule_coro(e.start_async())
450 with pytest.raises(RuntimeError, match="Engine already running"):
451 yield deferred_from_coro(e.start_async())
452 yield deferred_from_coro(e.stop_async())
453
454 @pytest.mark.only_asyncio
455 @coroutine_test

Callers

nothing calls this directly

Calls 8

open_spider_asyncMethod · 0.95
start_asyncMethod · 0.95
stop_asyncMethod · 0.95
get_crawlerFunction · 0.90
ExecutionEngineClass · 0.90
deferred_from_coroFunction · 0.90
_schedule_coroFunction · 0.90
_create_spiderMethod · 0.80

Tested by

no test coverage detected