Skip to content

Commit

Permalink
Merge pull request #1 from Xewdy444/deepsource-fix-e9472ab3
Browse files Browse the repository at this point in the history
Merge collapsible `with` statements
  • Loading branch information
Xewdy444 authored Jan 20, 2023
2 parents f3a3ec3 + 1ee1341 commit de07583
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/test_sync_recaptchav3.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ def test_recaptcha_not_found() -> None:
page = browser.new_page()
page.goto("https://www.google.com/")

with pytest.raises(RecaptchaTimeoutError):
with recaptchav3.SyncSolver(page, timeout=10) as solver:
solver.solve_recaptcha()
with pytest.raises(RecaptchaTimeoutError), recaptchav3.SyncSolver(page, timeout=10) as solver:
solver.solve_recaptcha()


def test_recaptcha_version_error() -> None:
Expand All @@ -51,6 +50,5 @@ def test_recaptcha_version_error() -> None:
page = browser.new_page()
page.goto("https://cobra.ehr.com/ESS/Home/Login.aspx")

with pytest.raises(RecaptchaVersionError):
with recaptchav3.SyncSolver(page) as solver:
solver.solve_recaptcha()
with pytest.raises(RecaptchaVersionError), recaptchav3.SyncSolver(page) as solver:
solver.solve_recaptcha()

0 comments on commit de07583

Please sign in to comment.