Closed sehHeiden closed 6 days ago
In Pytest:
e.value.errors() is needed!
Hello @sehHeiden So what is your issue now?
Yes, you need to use the e.value
instead of just e
to access the exception object and then you can use the errors
method.
Well, I found the problem myself. That's why a wrote a second statement. Would be nice, when I would have found the remark in documentation, though.
Hey @sehHeiden It's related more to the pytest
than to the pydantic-i18n
I think. Here is the description of this value
attribute usage:
https://docs.pytest.org/en/7.1.x/how-to/assert.html#assertions-about-expected-exceptions
I want to translate the error. Just the method to get the pydantic errors does not exist.
I tried:
Returns the error: AttributeError: 'ExceptionInfo' object has no attribute 'errors'
Environment