Closed greg-kinasa closed 5 months ago
There's nothing magic in automock. If you want to call the real function instead of the mock one, then make sure you call it through it's full path. i.e. don't call it through the path that uses mockall_double
. Or if you want to use the mock in some test cases but not others for the same code, you'll have to call the real version from .returning
.
In my case the mocked function is within several layers of code and conditionally brought it by feature flag. I wouldn't be opposed to calling the original through .returning
however it's async and after reading through existing issues it seems I'd have to change my function signatures to accommodate. Thanks for your prompt response.
Is there anything else you need here?
I'm using automock on a mod and have some tests that I want to utilize the mock but others that should call through the original function implementations. Is there a way to have this happen directly without grabbing the original function and calling it from
returning
?