-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I encountered a scenario where I wanted to use @mock not on a call site but rather on a reference to a function:
upload_with_retry = retry(upload, delays=fill(5.0, retries))
responses = upload_with_retry(ftp, file, "/")Due to the actual call of upload occurring within retry I can't actually get at the actual call site I'd like to mock. Currently you can rewrite this code to be:
upload_with_retry = retry((args...) -> @mock(upload(args...)), delays=fill(5.0, retries))
responses = upload_with_retry(ftp, file, "/")Which makes me feel like we should update @mock to allow just @mock upload to re-write the expression to essentially be (args; kwargs...) -> @mock upload(args...; kwargs...). I also have a suspicion this will help with solving #80
Metadata
Metadata
Assignees
Labels
No labels