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
I have several validation tests to confirm expected behavior and, when I try to verify that a pattern of "(unclosed" results in a ValidationError, my tests fail because the re.error thrown by re.compile() is being raised instead.
I tried defining a custom deserializer for Pattern, but it isn't getting executed
…r instead (#597)
* fix: catch re.error in re.Pattern compilation to raise ValidationError instead
Fixes#579
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
I have a data model that accepts a user-provided regular expression with the model defined as:
I have several validation tests to confirm expected behavior and, when I try to verify that a pattern of
"(unclosed"
results in aValidationError
, my tests fail because there.error
thrown byre.compile()
is being raised instead.I tried defining a custom deserializer for Pattern, but it isn't getting executed
Not sure if I'm doing something wrong with the configuration or if the default deserializer for
re.Pattern
needs to be updated.The text was updated successfully, but these errors were encountered: