-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow extensions to override snapshot equality check #548
Conversation
Codecov Report
@@ Coverage Diff @@
## master #548 +/- ##
=======================================
Coverage 99.91% 99.91%
=======================================
Files 19 19
Lines 1142 1145 +3
=======================================
+ Hits 1141 1144 +3
Misses 1 1 |
608b0b3
to
1777744
Compare
def test_updated_snapshots(generate_snapshots): | ||
_, testdir, initial = generate_snapshots | ||
testdir.makepyfile(test_file=initial["failed"]) | ||
result = testdir.runpytest("-v", "--snapshot-update") | ||
result.stdout.re_match_lines((r"1 snapshot updated\.")) | ||
assert result.ret == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing locally for me. For some reason, the serialized data is referring to the old value. Some odd caching issue somewhere.
|
||
def test_updated_snapshots(generate_snapshots): | ||
_, testdir, initial = generate_snapshots | ||
testdir.makepyfile(test_file=initial["failed"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be updating the saved file as expected that's why the test_approximate_match
is passing but test_failed_snapshots
and test_updated_snapshots
are failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed via pdb that's not it. It looks like a python bug, or maybe from pytest's bytecode rewriting
Seen the posted discussion |
459808b
to
0e27895
Compare
# [1.6.0](v1.5.0...v1.6.0) (2022-01-14) ### Features * allow extensions to override snapshot equality check ([#548](#548)) ([a44f1b9](a44f1b9))
🎉 This PR is included in version 1.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Allow extensions to override snapshot equality check. This is to enable adding "tolerance" to the check, as well as to satisfy use cases such as visual regression testing.
Related Issues
Checklist
Additional Comments
No additional comments.