Skip to content

Pretty diff of snapshot comparisons #22

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

Closed
iamogbz opened this issue Dec 6, 2019 · 2 comments · Fixed by #86
Closed

Pretty diff of snapshot comparisons #22

iamogbz opened this issue Dec 6, 2019 · 2 comments · Fixed by #86
Labels
feature request New feature or request
Milestone

Comments

@iamogbz
Copy link
Collaborator

iamogbz commented Dec 6, 2019

Is your feature request related to a problem? Please describe.

Diffing complex objects on assertion failure does not show only the change but the entire snapshot

Describe the solution you'd like

Should show the exact line and characters (tokens) that differ between snapshots

Describe alternatives you've considered

N/A

Additional context

N/A

@noahnu
Copy link
Collaborator

noahnu commented Dec 19, 2019

This should be done on the same raw string that's written to the file system, however we should also support custom types. E.g. how to pretty diff images via the image serializer plugin?

@noahnu noahnu added the feature request New feature or request label Dec 19, 2019
noahnu added a commit that referenced this issue Dec 22, 2019
fix: compare serialized snapshots, close #21
noahnu pushed a commit that referenced this issue Dec 24, 2019
* chore: ignore vscode settings

* test: remove non-deterministic test for unhashable set

* feat: improve assertion diff #22

fix: compare serialized snapshots, close #21

* wip: define serialize as abstract method

* chore: print full diff in verbose mode

* chore: don't collect coverage from abstract methods

* cr: simplify read raw, success style, toml

* wip: add back requirements.txt

* test: fix coverage reporting (#48)

* chore: do not report on implicitly covered lines

* wip: more explicit

* wip: all is not what it seems

* wip: run coverage without pytest-cov

* wip: fix coverage source config

* wip: fix coverage source config

Co-authored-by: Emmanuel Ogbizi <[email protected]>
@noahnu
Copy link
Collaborator

noahnu commented Dec 29, 2019

Only thing we're missing here is showing exact characters within a line. Should we only do this for single line diffs? I imagine it might be too verbose in the general case.

@noahnu noahnu added this to the v1.0.0 milestone Dec 29, 2019
@iamogbz iamogbz self-assigned this Dec 31, 2019
@iamogbz iamogbz removed their assignment Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants