Skip to content

Commit

Permalink
fix: use best-effort artifacts folder removal (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Oct 10, 2023
1 parent f00a018 commit ef99541
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pytest_playwright/pytest_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ def browser(launch_browser: Callable[[], Browser]) -> Generator[Browser, None, N
browser = launch_browser()
yield browser
browser.close()
artifacts_folder.cleanup()
try:
# On Windows, files can be still in use.
# https://github.com/microsoft/playwright-pytest/issues/163
artifacts_folder.cleanup()
except (PermissionError, NotADirectoryError):
pass


@pytest.fixture
Expand Down

0 comments on commit ef99541

Please sign in to comment.