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 99ec471
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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

0 comments on commit 99ec471

Please sign in to comment.