Skip to content

Commit

Permalink
cleaner error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
drammock committed Oct 8, 2024
1 parent 23b711b commit 8fccb62
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
try:
from pathlib import UnsupportedOperation # added in Py 3.13
except ImportError:
UnsupportedOperation = None
UnsupportedOperation = NotImplementedError

# Using importorskip to ensure these tests are only loaded if Playwright is installed.
playwright = pytest.importorskip("playwright")
Expand Down Expand Up @@ -45,8 +45,8 @@ def test_colors(sphinx_build_factory, page: Page, url_base: str) -> None:
try:
symlink_path.symlink_to(sphinx_build.outdir, True)
page.goto(urljoin(url_base, "playwright_tests/colors/index.html"))
except (NotImplementedError, UnsupportedOperation):
print("filesystem doesn't support symlinking")
except UnsupportedOperation:
pytest.xfail("filesystem doesn't support symlinking")
else:
# check the colors
primary_color = "rgb(10, 125, 145)"
Expand Down Expand Up @@ -119,8 +119,8 @@ def test_breadcrumbs_everywhere(
page.goto(
urljoin(url_base, "playwright_tests/breadcrumbs/hansel/gretel/house.html")
)
except (NotImplementedError, UnsupportedOperation):
print("filesystem doesn't support symlinking")
except UnsupportedOperation:
pytest.xfail("filesystem doesn't support symlinking")
else:
# sidebar should overflow
text = "In the oven with my sister, so hot right now. Soooo. Hotttt."
Expand Down

0 comments on commit 8fccb62

Please sign in to comment.