Skip to content

Commit

Permalink
Fixes failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
desertaxle committed Jul 31, 2024
1 parent b97429b commit cec7998
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
4 changes: 2 additions & 2 deletions tests/cli/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
}


Expand Down
4 changes: 2 additions & 2 deletions tests/cli/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand Down
10 changes: 3 additions & 7 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"},
}
Expand All @@ -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,
)

Expand Down

0 comments on commit cec7998

Please sign in to comment.