MCPcopy Create free account
hub / github.com/dot-agent/nextpy / test_update_from_env

Function test_update_from_env

tests/test_config.py:66–78  ·  view source on GitHub ↗

Test that environment variables override config values. Args: base_config_values: Config values. monkeypatch: The pytest monkeypatch object. env_var: The environment variable name. value: The environment variable value.

(base_config_values, monkeypatch, env_var, value)

Source from the content-addressed store, hash-verified

64 ],
65)
66def test_update_from_env(base_config_values, monkeypatch, env_var, value):
67 """Test that environment variables override config values.
68
69 Args:
70 base_config_values: Config values.
71 monkeypatch: The pytest monkeypatch object.
72 env_var: The environment variable name.
73 value: The environment variable value.
74 """
75 monkeypatch.setenv(env_var, str(value))
76 assert os.environ.get(env_var) == str(value)
77 config = xt.Config(**base_config_values)
78 assert getattr(config, env_var.lower()) == value
79
80
81@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

lowerMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected