Fix tests

This commit is contained in:
Adrián Chaves 2025-03-26 10:40:27 +01:00
parent 701f582f27
commit 7b89aeba0b
2 changed files with 4 additions and 8 deletions

View File

@ -180,7 +180,8 @@ class ExecutionEngine:
self._start = None
exception_traceback = format_exc()
logger.error(
f"Error while reading start items and requests: {exception}.\n{exception_traceback}"
f"Error while reading start items and requests: {exception}.\n{exception_traceback}",
exc_info=True,
)
else:
if isinstance(item_or_request, Request):

View File

@ -456,13 +456,8 @@ class TestCrawlSpider(TestSpider):
crawler = get_crawler(TestSpider)
with LogCapture("scrapy.core.engine", propagate=False, level=ERROR) as log:
yield crawler.crawl()
log.check(
(
"scrapy.core.engine",
"ERROR",
"Error while reading start items and requests",
),
)
assert "Error while reading start items and requests" in str(log)
assert "did you miss an 's'?" in str(log)
class TestSitemapSpider(TestSpider):