Description
Describe the bug
When comparing a failed snapshot test on an object without a custom __repr__
(i.e. relies on syrupy's serializer), 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(...)])
).
This might be a PyCharm bug, or Syrupy or somehow both. Just thought I'd make this issue as it tripped me up at work for over an hour and I imagine a fair few people use PyCharm and syrupy together.
To reproduce
- checkout this repo I made
- create a virtualenv within and
pip install syrupy==3.0.2
- 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:
Expected behavior
This is roughly what I should see in the Comparison Failure window.
I know this is wrong because when I run pytest --snapshot-update
, it updates the snapshot like this.
Screenshots
added throughout where appropriate
Environment:
- OS: Windows 11 Pro 21H2
- Syrupy Version: 3.0.2
- Python Version: 3.9.13
- PyCharm Version: 2022.3 (Community Edition), Build #PC-223.7571.203, built on December 1, 2022, Runtime version: 17.0.5+1-b653.14 amd64, VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Additional context
This is similar to #572 but not the same.