Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import re
import sys

import pytest

Expand Down Expand Up @@ -243,10 +244,13 @@ def test_catches_invalid_func(self):
with pytest.raises(ValueError) as ei:
matches_re("a", 0, lambda: None)

assert (
"'func' must be one of None, fullmatch, match, search."
== ei.value.args[0]
)
if sys.version_info >= (3, 15):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to keep support for Python 3.15 alpha 6 by checking the whole version:

Suggested change
if sys.version_info >= (3, 15):
if sys.version_info >= (3, 15, 0, 'alpha', 7):

I don't think that it's worth it to support older alpha versions, so I just wrote (3, 15).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for us there's only the next big release, so this is correct

errmsg = (
"'func' must be one of None, fullmatch, prefixmatch, search."
)
else:
errmsg = "'func' must be one of None, fullmatch, match, search."
assert errmsg == ei.value.args[0]

@pytest.mark.parametrize(
"func", [None, getattr(re, "fullmatch", None), re.match, re.search]
Expand Down
Loading