-
-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
add more arguments to the customize hook which give the user some information about the location in the snapshot, which is useful in cases like this:
from inline_snapshot import snapshot
def request(user):
return {"user":user,"age": len(user)*2}
def test():
user="Tom"
assert request(user) == snapshot({"user":user,"age":6})where the key of the dict entry can be used to find the correct variable.
def customize(value, snapshot_path):
...snapshot_path is a list of locations in the snapshot in this case [DictValue(key="user")], but in can contain other entries like ListIndex or CallArgument.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels