Closed estyrke closed 3 years ago
Apparently, the problematic code does not exist in 0.6.0 anymore, so maybe the issue is solved already. It doesn't seem to be available on pypi yet though.
The latest release is 1.0.0a0 which is on PyPI. Want to give that a try?
Not sure what I did wrong last time, but indeed, 0.6.0 has fixed this issue, and 1.0.0a0 works as well.
If a snapshot contains a (possibly nested) dict with a key named "self", snapshottest will crash in the SortedDict constructor with the error
TypeError: __init__() got multiple values for argument 'self'
. There doesn't seem to be an obvious solution, because whatever name is chosen for theself
parameter inSortedDict.__init__
, it risks colliding with the incoming dict keys. Calling it something more contrived, like__SortedDict__self__
might mitigate the problem.Minimal pytest example: