diff --git a/pyorbital/tests/test_tlefile.py b/pyorbital/tests/test_tlefile.py index c04572d..d3203b7 100644 --- a/pyorbital/tests/test_tlefile.py +++ b/pyorbital/tests/test_tlefile.py @@ -183,39 +183,18 @@ def test_check_is_platform_supported_unknown(caplog): assert expected3 in logoutput_lines[2] -#def test_get_config_path_ppp_config_set_but_not_pyorbital_future(mock, caplog, monkeypatch): -# """Test getting the config path.""" -# monkeypatch.setenv("SATPY_CONFIG_PATH", "/path/to/satpy/etc") -# monkeypatch.setenv("PPP_CONFIG_DIR", "/path/to/old/mpop/config/dir") -# -# with caplog.at_level(logging.WARNING): -# res = _get_config_path() -# -# log_output = ("The use of PPP_CONFIG_DIR is no longer supported! " + -# "Please use PYORBITAL_CONFIG_PATH if you need a custom config path for pyorbital!") -# assert log_output in caplog.text -# assert res == PKG_CONFIG_DIR - - -def test_get_config_path_ppp_config_set_but_not_pyorbital_is_deprecated(caplog, monkeypatch): - """Test getting the config path. - - Here the case is tested when the new Pyorbital environment variable is not - set but the deprecated (old) Satpy/MPOP one is set. - - """ +def test_get_config_path_ppp_config_set_but_not_pyorbital_future(caplog, monkeypatch): + """Test getting the config path.""" monkeypatch.setenv("SATPY_CONFIG_PATH", "/path/to/satpy/etc") monkeypatch.setenv("PPP_CONFIG_DIR", "/path/to/old/mpop/config/dir") with caplog.at_level(logging.WARNING): res = _get_config_path() - assert res == "/path/to/old/mpop/config/dir" - - log_output = ("The use of PPP_CONFIG_DIR is deprecated and will be removed in version 1.9!" + - " Please use PYORBITAL_CONFIG_PATH if you need a custom config path for pyorbital!") - + log_output = ("The use of PPP_CONFIG_DIR is no longer supported! " + + "Please use PYORBITAL_CONFIG_PATH if you need a custom config path for pyorbital!") assert log_output in caplog.text + assert res == PKG_CONFIG_DIR def test_get_config_path_ppp_config_set_and_pyorbital(caplog, monkeypatch): diff --git a/pyorbital/tlefile.py b/pyorbital/tlefile.py index e8f0305..a9765f4 100644 --- a/pyorbital/tlefile.py +++ b/pyorbital/tlefile.py @@ -63,16 +63,11 @@ class TleDownloadTimeoutError(Exception): def _get_config_path(): """Get the config path for Pyorbital.""" if "PPP_CONFIG_DIR" in os.environ and "PYORBITAL_CONFIG_PATH" not in os.environ: - # XXX: Swap when pyorbital 1.9 is released - #LOGGER.warning( - # "The use of PPP_CONFIG_DIR is no longer supported!" + - # " Please use PYORBITAL_CONFIG_PATH if you need a custom config path for pyorbital!") - #LOGGER.debug("Using the package default for configuration: %s", PKG_CONFIG_DIR) - #return PKG_CONFIG_DIR LOGGER.warning( - "The use of PPP_CONFIG_DIR is deprecated and will be removed in version 1.9!" + + "The use of PPP_CONFIG_DIR is no longer supported!" + " Please use PYORBITAL_CONFIG_PATH if you need a custom config path for pyorbital!") - pyorbital_config_path = os.getenv("PPP_CONFIG_DIR", PKG_CONFIG_DIR) + LOGGER.debug("Using the package default for configuration: %s", PKG_CONFIG_DIR) + return PKG_CONFIG_DIR else: pyorbital_config_path = os.getenv("PYORBITAL_CONFIG_PATH", PKG_CONFIG_DIR)