Open LuisFros opened 3 years ago
This looks great, however I think we may not need a new assert_match_with_ignore
.
We can probably just add the clear_ignore_keys
method so people can use assert_match
normally.
@syrusakbary thank you for your answer, sounds like a good proposal.
I am using pytest and one reason to add a new method was that it's more practical to use the fixture and then snapshot.assert_match_with_ignore
instead of having to import a method from the library like from snapshot.utils import clear_ignore_keys
every time we need to use it. What are your thoughts on this?
Description
This is a complementary method to allow asserting snapshots while ignoring certain fields.
Why?
IDs
that will change in between test batteries. (For example if databases are reused or random test order impliesIDs
are not unique)Solution
It covers recursive:
Additionally, it allows to exclude multiple values in the same "level".