Skip to content

Commit

Permalink
update tests to support new version string conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Jan 9, 2024
1 parent 7cca819 commit 13c54b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
from xclim.testing.utils import get_file
from xclim.testing.utils import open_dataset as _open_dataset

if not __xclim_version__.endswith("-beta") and helpers.TESTDATA_BRANCH == "main":
if (
re.match(r"^\d+\.\d+\.\d+$", __xclim_version__)
and helpers.TESTDATA_BRANCH == "main"
):
# This does not need to be emitted on GitHub Workflows and ReadTheDocs
if not os.getenv("CI") and not os.getenv("READTHEDOCS"):
warnings.warn(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def func(da, arg1, arg2=None, arg3=None):
out = func(atmosds.tas, 1, arg2=[1, 2], arg3=None)

matches = re.match(
r"\[([0-9-:\s]*)\]\s(\w*):\s(\w*)\((.*)\)\s-\sxclim\sversion:\s(\d*\.\d*\.\d*[a-zA-Z-]*)",
r"\[([0-9-:\s]*)]\s(\w*):\s(\w*)\((.*)\)\s-\sxclim\sversion:\s(\d*\.\d*\.\d*[a-zA-Z-]*(\.\d*)?)",
out.attrs["history"],
).groups()

Expand Down

0 comments on commit 13c54b1

Please sign in to comment.