joseph-roitman / pytest-snapshot

A plugin for snapshot testing with pytest.
MIT License
113 stars 11 forks source link

Snapshot testing of API response with excluding specific fields #70

Open alexjolig opened 5 months ago

alexjolig commented 5 months ago

Is there a way to exclude a list of fields from the json response of an API while testing with snapshot?

For example if there are keys like updated_at, a randomly generated code or a new id

drjasonharrison commented 2 weeks ago

work around: delete the random or unimportant fields/data before performing the comparison.