MCPcopy
hub / github.com/scrapy/scrapy / __init__

Method __init__

tests/test_scheduler.py:88–99  ·  view source on GitHub ↗
(self, priority_queue_cls: str, jobdir: Path | None)

Source from the content-addressed store, hash-verified

86
87class MockCrawler(Crawler):
88 def __init__(self, priority_queue_cls: str, jobdir: Path | None):
89 settings = {
90 "SCHEDULER_DEBUG": False,
91 "SCHEDULER_DISK_QUEUE": "scrapy.squeues.PickleLifoDiskQueue",
92 "SCHEDULER_MEMORY_QUEUE": "scrapy.squeues.LifoMemoryQueue",
93 "SCHEDULER_PRIORITY_QUEUE": priority_queue_cls,
94 "JOBDIR": str(jobdir) if jobdir is not None else None,
95 "DUPEFILTER_CLASS": "scrapy.dupefilters.BaseDupeFilter",
96 }
97 super().__init__(Spider, settings)
98 self.engine = Mock(downloader=MockDownloader())
99 self.stats = load_object(self.settings["STATS_CLASS"])(self)
100
101
102@asynccontextmanager

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 2

load_objectFunction · 0.90
MockDownloaderClass · 0.85

Tested by

no test coverage detected