diff --git a/tests/core/_orchestrator/test_orchestrator_factory.py b/tests/core/_orchestrator/test_orchestrator_factory.py index d4e387d42f..f7536cac31 100644 --- a/tests/core/_orchestrator/test_orchestrator_factory.py +++ b/tests/core/_orchestrator/test_orchestrator_factory.py @@ -111,6 +111,9 @@ def test_build_unknown_dispatcher(): _OrchestratorFactory._build_dispatcher() assert _OrchestratorFactory._dispatcher is None + Config.configure_job_executions(mode=JobConfig._DEVELOPMENT_MODE) + _OrchestratorFactory._build_dispatcher() + def test_remove_dispatcher_not_built(): _OrchestratorFactory._dispatcher = None diff --git a/tests/core/config/test_override_config.py b/tests/core/config/test_override_config.py index 192809535c..e7406422ce 100644 --- a/tests/core/config/test_override_config.py +++ b/tests/core/config/test_override_config.py @@ -60,13 +60,14 @@ def test_override_default_configuration_with_code_configuration(): def test_override_default_config_with_code_config_including_env_variable_values(): Config.configure_core() assert Config.core.repository_type == "filesystem" - Config.configure_core(repository_type="othertype") - assert Config.core.repository_type == "othertype" with mock.patch.dict(os.environ, {"REPOSITORY_TYPE": "foo"}): Config.configure_core(repository_type="ENV[REPOSITORY_TYPE]") assert Config.core.repository_type == "foo" + Config.configure_core(repository_type="othertype") + assert Config.core.repository_type == "othertype" + def test_override_default_configuration_with_file_configuration(): tf = NamedTemporaryFile( diff --git a/tests/core/conftest.py b/tests/core/conftest.py index 915b9560ab..cfc8bb0841 100644 --- a/tests/core/conftest.py +++ b/tests/core/conftest.py @@ -181,14 +181,9 @@ def default_multi_sheet_data_frame(): def cleanup_files(): yield - if os.path.exists(".data"): - shutil.rmtree(".data", ignore_errors=True) - if os.path.exists("user_data"): - shutil.rmtree("user_data", ignore_errors=True) - if os.path.exists(".taipy"): - shutil.rmtree(".taipy", ignore_errors=True) - if os.path.exists(".my_data"): - shutil.rmtree(".my_data", ignore_errors=True) + for path in [".data", ".my_data", "user_data", ".taipy"]: + if os.path.exists(path): + shutil.rmtree(path, ignore_errors=True) @pytest.fixture(scope="function") @@ -332,6 +327,12 @@ def clean_repository(init_config, init_managers, init_orchestrator, init_notifie with patch("sys.argv", ["prog"]): yield + close_all_sessions() + init_orchestrator() + init_managers() + init_config() + init_notifier() + @pytest.fixture def init_config(reset_configuration_singleton, inject_core_sections):