Skip to content

Commit

Permalink
chore: Ignore some errors when cleaning up output_dir (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerichokeyne committed Feb 10, 2022
1 parent 6165a13 commit dd2cd3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pytest_playwright/pytest_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@
def delete_output_dir(pytestconfig: Any) -> None:
output_dir = pytestconfig.getoption("--output")
if os.path.exists(output_dir):
shutil.rmtree(output_dir)
try:
shutil.rmtree(output_dir)
except FileNotFoundError:
# When running in parallel, another thread may have already deleted the files
pass


def pytest_generate_tests(metafunc: Any) -> None:
Expand Down

0 comments on commit dd2cd3a

Please sign in to comment.