Skip to content

Commit 73e023a

Browse files
Explicitly ignore config file
1 parent e23b4ac commit 73e023a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_model_serving_auth.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
([('IS_IN_DATABRICKS_MODEL_SERVING_ENV', 'true'),
2424
('DATABRICKS_MODEL_SERVING_HOST_URL', 'x')], "tests/testdata/model-serving-test-token"), ])
2525
def test_model_serving_auth(env_values, oauth_file_name, monkeypatch):
26+
# Guarantee that the tests defaults to env variables rather than config file.
27+
#
28+
# TODO: this is hacky and we should find a better way to tell the config
29+
# that it should not read from the config file.
30+
monkeypatch.setenv('DATABRICKS_CONFIG_FILE', 'x')
31+
2632
## In mlflow we check for these two environment variables to return the correct config
2733
for (env_name, env_value) in env_values:
2834
monkeypatch.setenv(env_name, env_value)
@@ -49,6 +55,12 @@ def test_model_serving_auth(env_values, oauth_file_name, monkeypatch):
4955
])
5056
@raises(default_auth_base_error_message)
5157
def test_model_serving_auth_errors(env_values, oauth_file_name, monkeypatch):
58+
# Guarantee that the tests defaults to env variables rather than config file.
59+
#
60+
# TODO: this is hacky and we should find a better way to tell the config
61+
# that it should not read from the config file.
62+
monkeypatch.setenv('DATABRICKS_CONFIG_FILE', 'x')
63+
5264
for (env_name, env_value) in env_values:
5365
monkeypatch.setenv(env_name, env_value)
5466
monkeypatch.setattr(
@@ -59,6 +71,12 @@ def test_model_serving_auth_errors(env_values, oauth_file_name, monkeypatch):
5971

6072

6173
def test_model_serving_auth_refresh(monkeypatch):
74+
# Guarantee that the tests defaults to env variables rather than config file.
75+
#
76+
# TODO: this is hacky and we should find a better way to tell the config
77+
# that it should not read from the config file.
78+
monkeypatch.setenv('DATABRICKS_CONFIG_FILE', 'x')
79+
6280
## In mlflow we check for these two environment variables to return the correct config
6381
monkeypatch.setenv('IS_IN_DB_MODEL_SERVING_ENV', 'true')
6482
monkeypatch.setenv('DB_MODEL_SERVING_HOST_URL', 'x')

0 commit comments

Comments
 (0)