Add a function for calling the original spied-on function.
Review Request #10631 — Created July 19, 2019 and submitted — Latest diff uploaded
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.