MCPcopy
hub / github.com/scrapy/scrapy / test_no_output

Method test_no_output

tests/test_command_crawl.py:26–44  ·  view source on GitHub ↗
(self, proj_path: Path)

Source from the content-addressed store, hash-verified

24 return stderr
25
26 def test_no_output(self, proj_path: Path) -> None:
27 spider_code = """
28import scrapy
29
30class MySpider(scrapy.Spider):
31 name = 'myspider'
32
33 async def start(self):
34 self.logger.debug('It works!')
35 return
36 yield
37"""
38 log = self.get_log(spider_code, proj_path)
39 assert "[myspider] DEBUG: It works!" in log
40 assert (
41 "Using reactor: twisted.internet.asyncioreactor.AsyncioSelectorReactor"
42 in log
43 )
44 assert "Spider closed (finished)" in log
45
46 def test_output(self, proj_path: Path) -> None:
47 spider_code = """

Callers

nothing calls this directly

Calls 1

get_logMethod · 0.95

Tested by

no test coverage detected