diff --git a/datacube/cfg/api.py b/datacube/cfg/api.py index 231548669..850732ba4 100644 --- a/datacube/cfg/api.py +++ b/datacube/cfg/api.py @@ -214,7 +214,7 @@ def __init__(self, self._allow_envvar_overrides: bool = allow_env_overrides self._normalised: dict[str, Any] = {} - if name == "user" and "default_environment" in raw: + if name == "user" and "default_environment" in raw: warnings.warn("The 'default_environment' setting in the 'user' section is no longer supported - " "please refer to the documentation for more information") diff --git a/tests/test_cfg.py b/tests/test_cfg.py index 1ac0e2165..75d85d18f 100644 --- a/tests/test_cfg.py +++ b/tests/test_cfg.py @@ -187,7 +187,7 @@ def test_invalid_env(): def test_oldstyle_cfg(): - from datacube.cfg.api import ODCConfig, ConfigException + from datacube.cfg.api import ODCConfig with pytest.warns(UserWarning, match=r'default_environment.*no longer supported'): cfg = ODCConfig(text=""" default: