Skip to content

Commit

Permalink
Refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
elacuesta committed Oct 3, 2022
1 parent a9a5c48 commit f9daf64
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_playwright_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,12 @@ async def init_page(page, unused_arg):
headers = json.loads(response.css("pre::text").get())
headers = {key.lower(): value for key, value in headers.items()}
assert "extra-header" not in headers
assert (
"scrapy-playwright",
logging.WARNING,
f"[Context=default] Page init callback exception for {req!r}"
" (TypeError(\"init_page() missing 1 required positional argument: 'unused_arg'\"))",
) in caplog.record_tuples

log_entry = caplog.record_tuples[0]
assert log_entry[0] == "scrapy-playwright"
assert log_entry[1] == logging.WARNING
assert f"[Context=default] Page init callback exception for {req!r}" in log_entry[2]
assert "init_page() missing 1 required positional argument: 'unused_arg'" in log_entry[2]


class TestCaseChromium(MixinTestCase):
Expand Down

0 comments on commit f9daf64

Please sign in to comment.