Closed neotechmonk closed 1 month ago
Apologies for the delayed response here. This is not a bug in msgspec but rather a pytest
behavior. When pytest collects tests it assumes any class named Test*
is a test class and tries to instantiate it and collect tests off it. If you rename your struct type to something that doesn't start with "Test"
then things should work fine.
Description
Setup Struct based class
Importing the TestModel for further unit testing
When I run pytest on the unittest module I get this error
The above error is addressed by assigning a default value
key: Annotated[str, msgspec.Meta(max_length=6)] = "test"
However running pytest again leads to this error
When I implement
__hash__()
like the below both errors are resolvedIs this is an issue or am I using the library in a wrong way?