Skip to content

Commit f72f333

Browse files
committed
Fix issue with parallel tests that use the dashboard
1 parent 2400757 commit f72f333

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

seleniumbase/core/download_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def reset_downloads_folder():
3434
def reset_downloads_folder_assistant(archived_downloads_folder):
3535
if not os.path.exists(archived_downloads_folder):
3636
try:
37-
os.makedirs(archived_downloads_folder)
37+
os.makedirs(archived_downloads_folder, exist_ok=True)
3838
except Exception:
3939
pass # Should only be reachable during multi-threaded test runs
4040
new_archived_downloads_sub_folder = "%s/downloads_%s" % (
@@ -45,7 +45,7 @@ def reset_downloads_folder_assistant(archived_downloads_folder):
4545
if not os.listdir(downloads_path) == []:
4646
try:
4747
shutil.move(downloads_path, new_archived_downloads_sub_folder)
48-
os.makedirs(downloads_path)
48+
os.makedirs(downloads_path, exist_ok=True)
4949
except Exception:
5050
pass
5151
if not settings.ARCHIVE_EXISTING_DOWNLOADS:

seleniumbase/plugins/pytest_plugin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,10 @@ def _create_dashboard_assets_():
16821682
abs_path = os.path.abspath(".")
16831683
assets_folder = os.path.join(abs_path, "assets")
16841684
if not os.path.exists(assets_folder):
1685-
os.makedirs(assets_folder)
1685+
try:
1686+
os.makedirs(assets_folder, exist_ok=True)
1687+
except Exception:
1688+
pass
16861689
pytest_style_css = os.path.join(assets_folder, "pytest_style.css")
16871690
add_pytest_style_css = True
16881691
if os.path.exists(pytest_style_css):

0 commit comments

Comments
 (0)