Skip to content

Commit

Permalink
Use a more granular warning assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallaecio committed Jan 29, 2024
1 parent 8f57461 commit 7484cf4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ def parse(self, response: scrapy.http.Response):
)
@inlineCallbacks
def test_parse_callback_none_no_annotated_deps() -> None:
"""Similar to ``test_parse_callback_none_dummy_response()`` but there are no
annotated dependencies.
"""Similar to ``test_parse_callback_none_dummy_response()`` but there are
no annotated dependencies.
No warnings should be issued here.
"""
Expand All @@ -595,10 +595,10 @@ def parse(self, response):

crawler = make_crawler(TestSpider)

with warnings.catch_warnings(record=True) as warning_msg:
with warnings.catch_warnings(record=True) as w:
yield crawler.crawl()

assert not warning_msg
assert not any("with callback=None" in str(warning.message) for warning in w)
assert isinstance(collected["response"], scrapy.http.Response)


Expand Down

0 comments on commit 7484cf4

Please sign in to comment.