Skip to content

Commit 9a0c95e

Browse files
committed
test: fix TestProviderWiring inheriting duplicate tests from TestLoadConfig
1 parent 8b47941 commit 9a0c95e

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

tests/unit/config/test_config.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,22 @@ def test_any_platform_toolset_active(self, kwargs, expected):
612612
assert settings.any_platform_toolset_active is expected
613613

614614

615-
class TestProviderWiring(TestLoadConfig):
616-
"""Tests that load_config() passes the correct credentials provider to each provider.
615+
class TestProviderWiring:
616+
"""Tests that load_config() passes the correct credentials provider to each provider."""
617617

618-
Extends TestLoadConfig to reuse _load_config_with_env and setup_method.
619-
"""
618+
def _load_config_with_env(self, env_vars):
619+
with (
620+
patch.dict(os.environ, env_vars),
621+
patch("dbt_mcp.config.config.DbtMcpSettings") as mock_settings_class,
622+
patch(
623+
"dbt_mcp.config.config.detect_binary_type",
624+
return_value=BinaryType.DBT_CORE,
625+
),
626+
):
627+
with patch.dict(os.environ, env_vars, clear=True):
628+
settings_instance = DbtMcpSettings(_env_file=None)
629+
mock_settings_class.return_value = settings_instance
630+
return load_config()
620631

621632
def test_platform_providers_get_eliciting_wrapper_default_mode(self):
622633
"""Default mode -- platform providers get ElicitingCredentialsProvider."""

0 commit comments

Comments
 (0)