Closed ManiacDC closed 9 months ago
<...>
is the old amber syntax and didn't support syntax highlighting too well.
In the latest version of syrupy, classes are serialized as MyClass(...)
. We can probably do something similar for functions.
Would you be interested in opening a PR and contributing?
Sure, I'll try to get to that soon.
@noahnu sorry for the delay, I've opened a PR to address this issue.
:tada: This issue has been resolved in version 4.6.0 :tada:
The release is available on:
v4.6.0
Your semantic-release bot :package::rocket:
Is your feature request related to a problem? Please describe.
When trying to compare snapshots with attributes that contain functions, the function repr is returned as
<function request_response.<locals>.app at 0x7fbf103dc0e0>
The "at 0x..." part changes with each run of the test, I'm assuming it's a memory location.
Describe the solution you'd like
I'd like the
at 0x...
part to be removed.Describe alternatives you've considered
I've worked around this using a matcher:
Additional context
This could be implemented in the ambr and json snapshot extensions.
In ambr (serializer.py):
In json: