Skip to content

Commit

Permalink
Add timeframe to warning about using find_first_match without ensure_…
Browse files Browse the repository at this point in the history
…strategy
  • Loading branch information
ludeeus committed Mar 20, 2024
1 parent 14d3035 commit 8345a85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion awesomeversion/awesomeversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def __init__(

if find_first_match and not ensure_strategy:
warn(
"Can not use find_first_match without ensure_strategy",
"Can not use find_first_match without ensure_strategy, "
"this is ignored and will start raising an exception in 2025.",
stacklevel=2,
)

Expand Down
5 changes: 3 additions & 2 deletions tests/test_awesomeversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ def test_find_first_match_exception() -> None:
"""Test"""
with warnings.catch_warnings(record=True) as warning_list:
assert AwesomeVersion("1", find_first_match=True)
assert "Can not use find_first_match without ensure_strategy" in str(
warning_list[-1].message
assert (
"Can not use find_first_match without ensure_strategy, this is ignored and will start raising an exception in 2025."
in str(warning_list[-1].message)
)


Expand Down

0 comments on commit 8345a85

Please sign in to comment.