diff --git a/tests/test_preview.py b/tests/test_preview.py index 48db40f..c0487bc 100644 --- a/tests/test_preview.py +++ b/tests/test_preview.py @@ -148,7 +148,7 @@ 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: @@ -182,7 +182,7 @@ 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: