MCPcopy
hub / github.com/encode/starlette / test_config_with_env_prefix

Function test_config_with_env_prefix

tests/test_config.py:137–142  ·  view source on GitHub ↗
(tmpdir: Path, monkeypatch: pytest.MonkeyPatch)

Source from the content-addressed store, hash-verified

135
136
137def test_config_with_env_prefix(tmpdir: Path, monkeypatch: pytest.MonkeyPatch) -> None:
138 config = Config(environ={"APP_DEBUG": "value", "ENVIRONMENT": "dev"}, env_prefix="APP_")
139 assert config.get("DEBUG") == "value"
140
141 with pytest.raises(KeyError):
142 config.get("ENVIRONMENT")
143
144
145def test_config_with_encoding(tmpdir: Path) -> None:

Callers

nothing calls this directly

Calls 2

getMethod · 0.95
ConfigClass · 0.90

Tested by

no test coverage detected