Skip to content

lindenwells/syrupy-pycharm-diff-failure-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What's the bug?

When comparing a failed snapshot test on an object without a custom __repr__ (i.e. relies on syrupy's serialiser), PyCharm incorrectly displays the actual output as the default __repr__ (e.g. ...Mansion object at 0xBEEF2020) instead of what syrupy serialises it to (e.g. Mansion(rooms=[Room(...)])).

How to reproduce the bug

  1. checkout this repo
  2. create a virtualenv within and pip install syrupy
  3. find the singular test within the run configurations and notice that it fails.
  4. in the failed test output, scroll to the clickable '<Click to see difference>' text: image
  5. click that text and you should get a Comparison Failure interface like this: image
  6. This is wrong because when I run pytest --snapshot-update, it updates the snapshot like this. This is roughly what I should see in the Comparison Failure window.image

About

Minimum failing example for a syrupy/pycharm bug

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages