(self, priority_queue_cls: str, jobdir: Path | None)
| 86 | |
| 87 | class 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 |
no test coverage detected