You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe SnapshotAssertion needs to provide a __repr__ method.
Describe alternatives you've considered
None
Additional context
I already looked at implementing this but got caught up on things relating to self._executions and self.index.
Another hurdle is the way serialization happens. For example
assert dict_of_dicts == snapshot
snapshot will serialize into something that has types and dict_of_dicts will not have types in its __repr__. We could remove the types on the snapshot but I think comparing on types is a good idea and by just removing the types from the representation the diff (comparing on one thing and representing as another) could lead to confusing results when the assertion fails but the diff looks the same.
I would love this feature as well! It's easy enough to look at the test name and go find it in the .ambr file but it would be amazing to be able to use the built in diffing in pycharm to spot differences easily
Is your feature request related to a problem? Please describe.
Yes, when working in PyCharm I'll get output like
And when I "click to see difference" I'll get
Describe the solution you'd like
I believe SnapshotAssertion needs to provide a
__repr__
method.Describe alternatives you've considered
None
Additional context
I already looked at implementing this but got caught up on things relating to
self._executions
andself.index
.Another hurdle is the way serialization happens. For example
snapshot will serialize into something that has types and dict_of_dicts will not have types in its
__repr__
. We could remove the types on thesnapshot
but I think comparing on types is a good idea and by just removing the types from the representation the diff (comparing on one thing and representing as another) could lead to confusing results when the assertion fails but the diff looks the same.This seems relevant https://github.com/JetBrains/intellij-community/blob/master/python/helpers/pycharm/teamcity/pytest_plugin.py#L289
The text was updated successfully, but these errors were encountered: