Allow specifying a function name for spying on bad decorators.

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

chipx86
kgb
master
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.

Summary
Allow specifying a function name for spying on bad decorators.
david
  1. Ship It!
  2. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (8c2008e)
Loading...