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
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:
def function_matcher(data, path):
if isinstance(data, FunctionType):
return f"<function '{data.__qualname__}'>"
else:
return data
Additional context
This could be implemented in the ambr and json snapshot extensions.
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:
The text was updated successfully, but these errors were encountered: