From be5edeaef80337460c11b5268e2c700b3f1b4ee4 Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Thu, 18 Jul 2024 11:55:03 +0200 Subject: [PATCH] fix windows tests --- tests/test_config.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 894dd78a3..4bab85cf1 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -7,7 +7,7 @@ from databricks.sdk.config import Config, with_product, with_user_agent_extra from databricks.sdk.version import __version__ -from .conftest import noop_credentials +from .conftest import noop_credentials, set_az_path __tests__ = os.path.dirname(__file__) @@ -80,7 +80,7 @@ def test_config_copy_deep_copies_user_agent_other_info(config): def test_load_azure_tenant_id_404(requests_mock, monkeypatch): - monkeypatch.setenv('PATH', __tests__ + '/testdata:/bin') + set_az_path(monkeypatch) mock = requests_mock.get('https://abc123.azuredatabricks.net/aad/auth', status_code=404) cfg = Config(host="https://abc123.azuredatabricks.net") assert cfg.azure_tenant_id is None @@ -88,7 +88,7 @@ def test_load_azure_tenant_id_404(requests_mock, monkeypatch): def test_load_azure_tenant_id_no_location_header(requests_mock, monkeypatch): - monkeypatch.setenv('PATH', __tests__ + '/testdata:/bin') + set_az_path(monkeypatch) mock = requests_mock.get('https://abc123.azuredatabricks.net/aad/auth', status_code=302) cfg = Config(host="https://abc123.azuredatabricks.net") assert cfg.azure_tenant_id is None @@ -96,7 +96,7 @@ def test_load_azure_tenant_id_no_location_header(requests_mock, monkeypatch): def test_load_azure_tenant_id_unparsable_location_header(requests_mock, monkeypatch): - monkeypatch.setenv('PATH', __tests__ + '/testdata:/bin') + set_az_path(monkeypatch) mock = requests_mock.get('https://abc123.azuredatabricks.net/aad/auth', status_code=302, headers={'Location': 'https://unexpected-location'}) @@ -106,7 +106,7 @@ def test_load_azure_tenant_id_unparsable_location_header(requests_mock, monkeypa def test_load_azure_tenant_id_happy_path(requests_mock, monkeypatch): - monkeypatch.setenv('PATH', __tests__ + '/testdata:/bin') + set_az_path(monkeypatch) mock = requests_mock.get( 'https://abc123.azuredatabricks.net/aad/auth', status_code=302,