Skip to content

Commit

Permalink
Merge 1af922e into 61f0785
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Sep 21, 2022
2 parents 61f0785 + 1af922e commit 50eddf7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest
import yaml # type: ignore
from packaging.version import Version

import xdem
import xdem.misc
Expand Down Expand Up @@ -55,6 +56,7 @@ def test_deprecate(self, deprecation_increment: int | None, details: str | None)
:param deprecation_increment: The version number relative to the current version.
:param details: An optional explanation for the description.
"""

warnings.simplefilter("error")

current_version = xdem.version.version
Expand All @@ -71,8 +73,12 @@ def test_deprecate(self, deprecation_increment: int | None, details: str | None)
def useless_func() -> int:
return 1

# Example of why Version needs to be used below
assert not "0.0.10" > "0.0.8"
assert Version("0.0.10") > Version("0.0.8")

# If True, a warning is expected. If False, a ValueError is expected.
should_warn = removal_version is None or removal_version > current_version
should_warn = removal_version is None or Version(removal_version) > Version(current_version)

# Add the expected text depending on the parametrization.
text = (
Expand Down

0 comments on commit 50eddf7

Please sign in to comment.