Add a function for calling the original spied-on function.
Review Request #10631 — Created July 19, 2019 and submitted
Sometimes it's useful to spy on a function and override it (to influence
or track some state), but to then be able to invoke the original
This change implements this through a new
which will invoke the original function's bytecode. It will pass any
positional or keyword arguments to the original function, taking care to
pass the correct
clsfor bound/class methods. The call is
not logged, so it won't impact any spy tracking.
Examples of how to use this new functionality can be found in the
Unit tests pass for Python 2.7, 3.5, 3.6, and 3.7.
Fixed requirements for calling unbound methods. Added checks that the instance is passed, and updated unit tests accordingly.
Revision 2 (+258 -4)