diff --git a/pyproject.toml b/pyproject.toml index 22721ed465..ba35aff1e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -136,8 +136,11 @@ addopts = [ "--cov-report=html:test-reports/coverage_html", "--html=test-reports/report.html", ] -log_cli_level = "INFO" env = {MPLBACKEND = "Agg"} +filterwarnings = [ + "ignore:Do not instantiate `Config` objects directly:UserWarning" +] +log_cli_level = "INFO" log_level = "WARNING" minversion = "6" markers = [ diff --git a/tests/unit/config/test_config_object.py b/tests/unit/config/test_config_object.py index df3a923069..83f9b4e64e 100644 --- a/tests/unit/config/test_config_object.py +++ b/tests/unit/config/test_config_object.py @@ -63,8 +63,17 @@ def test_config_key_error(): config["invalid_key"] -def test_reload(cfg_default): +def test_reload( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, + cfg_default: Config, +) -> None: """Test `Config.reload`.""" + monkeypatch.setattr( + esmvalcore.config._config_object, + "USER_CONFIG_DIR", + tmp_path, + ) cfg = Config() cfg.reload()