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
Using custom matchers on an individual attribute basis but thats a giant pain.
You can use a matcher based on type rather than attribute name.
Regardless, this has come up before. Open to ideas/contributions.
Interesting, I'm not sure i understand the matcher system based on the docs, I came away with the impression it would simply be asserting an attribute had a specific type. I was hoping I could do something like that but failed and was looking at custom serializers.
Ideally i could just drop in the pytest.approx function, i would be happy to make a docs PR with an example of how to do it if you can show me how!
**Is your feature request related to a problem? Please describe **
We can't use syrupy when we are snapshotting objects with floats in them, due to precision issues.
Describe the solution you'd like
A way to set up a level of precision to match floats, ideally globally for all tests via a config option.
Describe alternatives you've considered
Using custom matchers on an individual attribute basis but thats a giant pain.
Additional context
The text was updated successfully, but these errors were encountered: