You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
________________________ test_invalid_regex[python-re] _________________________
engine = 'python-re'
@pytest.mark.parametrize('engine', [None, 'rust-regex', 'python-re'])
def test_invalid_regex(engine):
# TODO uncomment and fix once #150 is done
# with pytest.raises(SchemaError) as exc_info:
# SchemaValidator({'type': 'str', 'pattern': 123})
# assert exc_info.value.args[0] == (
# 'Error building "str" validator:\n TypeError: \'int\' object cannot be converted to \'PyString\''
# )
with pytest.raises(SchemaError) as exc_info:
SchemaValidator(core_schema.str_schema(pattern='(abc', regex_engine=engine))
if engine is None or engine == 'rust-regex':
assert exc_info.value.args[0] == (
'Error building "str" validator:\n'
' SchemaError: regex parse error:\n'
' (abc\n'
' ^\n'
'error: unclosed group'
)
elif engine == 'python-re':
> assert exc_info.value.args[0] == (
'Error building "str" validator:\n error: missing ), unterminated subpattern at position 0'
)
E assert 'Error buildi...at position 0' == 'Error buildi...at position 0'
E Error building "str" validator:
E - error: missing ), unterminated subpattern at position 0
E + PatternError: missing ), unterminated subpattern at position 0
E ? ++++ +++
tests/validators/test_string.py:190: AssertionError
=========================== short test summary info ============================
The text was updated successfully, but these errors were encountered:
Thanks for the report. Is this packaging with 3.13 or just a local dev build?
Upstream in PyO3 I haven't attempted to support 3.13 yet, so while it's nice to see it "works" I'd be fearful that other stuff might be subtly broken too. I intend to make it more clear to users what the expected outcome is: PyO3/pyo3#3555
That's a part of an early effort to integrate Python 3.13 into Fedora - we package everything with the consecutive alpha releases to provide the early feedback all the interested parties. It's not yet intended as a distribution package heading to the users, but the sooner we've got pydantic-core working, the sooner we can build packages that depend on it.
Understood, thanks. Looks like 3.13 is on GitHub actions, so we could begin testing it and at least trying to make it do sensible things. I wouldn't bet on it being reliable until I've had some time to try to get PyO3 synchronized.
When building pydantic-code for Fedora Linux with Python 3.13.0a3, one of the tests fails.
re.Error has been renamed to PatternError: https://docs.python.org/dev/whatsnew/3.13.html#re
The text was updated successfully, but these errors were encountered: