From cec7998ce538cbb4f3708e75c3624c6a2646c349 Mon Sep 17 00:00:00 2001 From: Alex Streed Date: Wed, 31 Jul 2024 11:42:23 -0500 Subject: [PATCH] Fixes failing tests --- tests/cli/test_config.py | 4 ++-- tests/cli/test_profile.py | 4 ++-- tests/test_context.py | 10 +++------- tests/test_settings.py | 7 +++---- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/tests/cli/test_config.py b/tests/cli/test_config.py index 9c4d3bb8a989..26fc8652286e 100644 --- a/tests/cli/test_config.py +++ b/tests/cli/test_config.py @@ -7,11 +7,11 @@ import prefect.settings from prefect.context import use_profile from prefect.settings import ( - PREFECT_API_DATABASE_CONNECTION_URL, PREFECT_API_DATABASE_TIMEOUT, PREFECT_API_KEY, PREFECT_LOGGING_TO_API_MAX_LOG_SIZE, PREFECT_PROFILES_PATH, + PREFECT_SERVER_ALLOW_EPHEMERAL_MODE, PREFECT_TEST_SETTING, SETTING_VARIABLES, Profile, @@ -68,7 +68,7 @@ def test_set_using_default_profile(): assert "ephemeral" in profiles assert profiles["ephemeral"].settings == { PREFECT_TEST_SETTING: "DEBUG", - PREFECT_API_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///prefect.db", + PREFECT_SERVER_ALLOW_EPHEMERAL_MODE: "true", } diff --git a/tests/cli/test_profile.py b/tests/cli/test_profile.py index 5a93205254f5..98ddca138222 100644 --- a/tests/cli/test_profile.py +++ b/tests/cli/test_profile.py @@ -9,11 +9,11 @@ from prefect.context import use_profile from prefect.settings import ( DEFAULT_PROFILES_PATH, - PREFECT_API_DATABASE_CONNECTION_URL, PREFECT_API_KEY, PREFECT_API_URL, PREFECT_DEBUG_MODE, PREFECT_PROFILES_PATH, + PREFECT_SERVER_ALLOW_EPHEMERAL_MODE, Profile, ProfilesCollection, _read_profiles_from, @@ -668,7 +668,7 @@ def test_populate_defaults_migrates_default(self, temporary_profiles_path): assert new_profiles.active_name == "ephemeral" assert new_profiles["ephemeral"].settings == { PREFECT_API_KEY: "test_key", - PREFECT_API_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///prefect.db", + PREFECT_SERVER_ALLOW_EPHEMERAL_MODE: "true", } def test_show_profile_changes(self, capsys): diff --git a/tests/test_context.py b/tests/test_context.py index 198654d9da18..da88fc170ea7 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -26,11 +26,11 @@ from prefect.results import ResultFactory from prefect.settings import ( DEFAULT_PROFILES_PATH, - PREFECT_API_DATABASE_CONNECTION_URL, PREFECT_API_KEY, PREFECT_API_URL, PREFECT_HOME, PREFECT_PROFILES_PATH, + PREFECT_SERVER_ALLOW_EPHEMERAL_MODE, Profile, ProfilesCollection, save_profiles, @@ -299,9 +299,7 @@ def test_root_settings_context_default(self, monkeypatch): use_profile.assert_called_once_with( Profile( name="ephemeral", - settings={ - PREFECT_API_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///prefect.db" - }, + settings={PREFECT_SERVER_ALLOW_EPHEMERAL_MODE: "true"}, source=DEFAULT_PROFILES_PATH, ), override_environment_variables=False, @@ -328,9 +326,7 @@ def test_root_settings_context_default_if_cli_args_do_not_match_format( use_profile.assert_called_once_with( Profile( name="ephemeral", - settings={ - PREFECT_API_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///prefect.db" - }, + settings={PREFECT_SERVER_ALLOW_EPHEMERAL_MODE: "true"}, source=DEFAULT_PROFILES_PATH, ), override_environment_variables=False, diff --git a/tests/test_settings.py b/tests/test_settings.py index 5e2eb0149da8..f47b3890cd31 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -23,6 +23,7 @@ PREFECT_LOGGING_LEVEL, PREFECT_LOGGING_SERVER_LEVEL, PREFECT_PROFILES_PATH, + PREFECT_SERVER_ALLOW_EPHEMERAL_MODE, PREFECT_SERVER_API_HOST, PREFECT_SERVER_API_PORT, PREFECT_TEST_MODE, @@ -581,7 +582,7 @@ def test_load_profiles_with_ephemeral(self, temporary_profiles_path): expected = { "ephemeral": { PREFECT_API_KEY: "foo", - PREFECT_API_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///prefect.db", # default value + PREFECT_SERVER_ALLOW_EPHEMERAL_MODE: "true", # default value }, "bar": {PREFECT_API_KEY: "bar"}, } @@ -592,9 +593,7 @@ def test_load_profiles_with_ephemeral(self, temporary_profiles_path): def test_load_profile_ephemeral(self): assert load_profile("ephemeral") == Profile( name="ephemeral", - settings={ - PREFECT_API_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///prefect.db" - }, + settings={PREFECT_SERVER_ALLOW_EPHEMERAL_MODE: "true"}, source=DEFAULT_PROFILES_PATH, )