Skip to content

Commit

Permalink
Update pytest_playwright.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Oct 10, 2023
1 parent 7c69858 commit 07d6472
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pytest_playwright/pytest_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,11 @@ def browser(launch_browser: Callable[[], Browser]) -> Generator[Browser, None, N
yield browser
browser.close()
try:
# On Windows, files can be still in use, so we do a best-effort in removing the folder
# On Windows, files can be still in use.
# https://github.com/microsoft/playwright-pytest/issues/163
artifacts_folder.cleanup()
except (PermissionError, NotADirectoryError):
for file in os.listdir(artifacts_folder.name):
try:
os.remove(os.path.join(artifacts_folder.name, file))
except Exception:
pass
pass


@pytest.fixture
Expand Down

0 comments on commit 07d6472

Please sign in to comment.