From 7d627d3d8275ce77afb4d7984867261e034db86d Mon Sep 17 00:00:00 2001 From: "nck.974" Date: Tue, 2 Jul 2024 18:14:21 +0200 Subject: [PATCH] fix: catch PermissionError when cleaning the tests results with multiple threads (#224) --- pytest_playwright/pytest_playwright.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_playwright/pytest_playwright.py b/pytest_playwright/pytest_playwright.py index e5b71a2..260e502 100644 --- a/pytest_playwright/pytest_playwright.py +++ b/pytest_playwright/pytest_playwright.py @@ -70,7 +70,7 @@ def delete_output_dir(pytestconfig: Any) -> None: if os.path.exists(output_dir): try: shutil.rmtree(output_dir) - except FileNotFoundError: + except (FileNotFoundError, PermissionError): # When running in parallel, another thread may have already deleted the files pass except OSError as error: