diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a978d99b6..1744681c8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -19,6 +19,7 @@ New features and enhancements Internal changes ^^^^^^^^^^^^^^^^ * `sphinx-codeautolink` and `pygments` have been temporarily pinned due to breaking API changes. (:pull:`2030`). +* Adjusted the ``TestOfficialYaml`` test to use a dynamic method for finding the installed location of `xclim`. (:pull:`2028`). v0.54.0 (2024-12-16) -------------------- diff --git a/tests/test_modules.py b/tests/test_modules.py index 37f5cbfcf..ba1697b18 100644 --- a/tests/test_modules.py +++ b/tests/test_modules.py @@ -1,5 +1,6 @@ from __future__ import annotations +from importlib.util import find_spec from inspect import _empty # noqa from pathlib import Path @@ -264,7 +265,7 @@ def test_validate(tmp_path): class TestOfficialYaml(yamale.YamaleTestCase): - base_dir = str(Path(__file__).parent.parent / "src" / "xclim" / "data") + base_dir = str(Path(find_spec("xclim").origin).parent.joinpath("data")) schema = "schema.yml" yaml = ["cf.yml", "anuclim.yml", "icclim.yml"]