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(...)])
).
- checkout this repo
- create a virtualenv within and
pip install syrupy
- find the singular test within the run configurations and notice that it fails.
- in the failed test output, scroll to the clickable '<Click to see difference>' text:
- click that text and you should get a Comparison Failure interface like this:
- 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.