diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index 04623dab..9f579657 100755 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -10821,7 +10821,6 @@ class BaseCase(unittest.TestCase): def __process_dashboard(self, has_exception, init=False): """ SeleniumBase Dashboard Processing """ - existing_res = sb_config._results # Used by multithreaded tests if self._multithreaded: abs_path = os.path.abspath(".") dash_json_loc = constants.Dashboard.DASH_JSON @@ -10909,8 +10908,8 @@ class BaseCase(unittest.TestCase): sb_config.item_count_untested -= 1 elif ( self._multithreaded - and test_id in existing_res.keys() - and existing_res[test_id] == "Skipped" + and test_id in sb_config._results.keys() + and sb_config._results[test_id] == "Skipped" ): sb_config._results[test_id] = "Skipped" sb_config.item_count_skipped += 1 diff --git a/seleniumbase/plugins/pytest_plugin.py b/seleniumbase/plugins/pytest_plugin.py index 85389ea9..3f4695fd 100644 --- a/seleniumbase/plugins/pytest_plugin.py +++ b/seleniumbase/plugins/pytest_plugin.py @@ -1483,7 +1483,7 @@ def _perform_pytest_unconfigure_(): pass -def pytest_unconfigure(): +def pytest_unconfigure(config): """ This runs after all tests have completed with pytest. """ if hasattr(sb_config, "_multithreaded") and sb_config._multithreaded: import fasteners @@ -1492,7 +1492,6 @@ def pytest_unconfigure(): if ( hasattr(sb_config, "dashboard") and sb_config.dashboard - and sb_config._dash_html ): # Multi-threaded tests with the Dashboard abs_path = os.path.abspath(".") @@ -1502,10 +1501,21 @@ def pytest_unconfigure(): sb_config._only_unittest = False dashboard_path = os.path.join(abs_path, "dashboard.html") with dash_lock: - with open(dashboard_path, "w", encoding="utf-8") as f: - f.write(sb_config._dash_html) + if ( + sb_config._dash_html + and config.getoption("htmlpath") == "dashboard.html" + ): + # Dash is HTML Report (Multithreaded) + sb_config._dash_is_html_report = True + with open(dashboard_path, "w", encoding="utf-8") as f: + f.write(sb_config._dash_html) + # Dashboard Multithreaded _perform_pytest_unconfigure_() return + else: + # Dash Lock is missing + _perform_pytest_unconfigure_() + return with dash_lock: # Multi-threaded tests _perform_pytest_unconfigure_() @@ -1513,6 +1523,7 @@ def pytest_unconfigure(): else: # Single-threaded tests _perform_pytest_unconfigure_() + return @pytest.fixture()