Skip to content

Commit

Permalink
Add additional failure condition when preview is reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Siecje committed Feb 3, 2024
1 parent 232e818 commit 40e46d0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ def test_preview_reload_css(run_start: CliRunner) -> None: # noqa: ARG001
while after == before:
try:
response = requests.get(url, timeout=0.1)
except requests.exceptions.ReadTimeout:
except (
requests.exceptions.ReadTimeout,
requests.exceptions.ConnectionError,
):
# happens during restart
read_timeout = True
else:
Expand Down Expand Up @@ -182,7 +185,10 @@ def test_preview_reload_js(run_start: CliRunner) -> None: # noqa: ARG001
while after == before:
try:
response = requests.get(url, timeout=0.1)
except requests.exceptions.ReadTimeout:
except (
requests.exceptions.ReadTimeout,
requests.exceptions.ConnectionError,
):
# happens during restart
read_timeout = True
else:
Expand Down

0 comments on commit 40e46d0

Please sign in to comment.