From 98a57e241879e1b56ef8bffeb8f85f868e91c1e9 Mon Sep 17 00:00:00 2001 From: Lidiane T Date: Mon, 27 Jan 2025 10:21:30 +0000 Subject: [PATCH] Fix error when running `scrapy bench` (#6633) --- scrapy/commands/bench.py | 2 +- tests/test_commands.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scrapy/commands/bench.py b/scrapy/commands/bench.py index 714bc38da..16dae6ac4 100644 --- a/scrapy/commands/bench.py +++ b/scrapy/commands/bench.py @@ -67,6 +67,6 @@ class _BenchSpider(scrapy.Spider): return [scrapy.Request(url, dont_filter=True)] def parse(self, response: Response) -> Any: - assert isinstance(Response, TextResponse) + assert isinstance(response, TextResponse) for link in self.link_extractor.extract_links(response): yield scrapy.Request(link.url, callback=self.parse) diff --git a/tests/test_commands.py b/tests/test_commands.py index 50f093043..872b54d04 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1034,6 +1034,7 @@ class BenchCommandTest(CommandTest): ) self.assertIn("INFO: Crawled", log) self.assertNotIn("Unhandled Error", log) + self.assertNotIn("log_count/ERROR", log) class ViewCommandTest(CommandTest):