• 
      

    Allow specifying a function name for spying on bad decorators.

    Review Request #11932 — Created Jan. 18, 2022 and submitted — Latest diff uploaded

    Information

    kgb
    master

    Reviewers

    kgb

    If a decorator fails to copy over the function name from the wrapped
    function, spying on the decorator can fail, due to the inability to
    locate the correct function for the slippery function check.

    This situation is now detected and a warning logged. It advises using
    a new parameter, func_name=, which enables a spy to specify an
    explicit function name. This is rarely needed, but useful when
    encountering this sort of situation.

    All unit tests pass on all supported versions of Python.

    Commits

    Files