You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
unittest shows wrong line number for decorated methods #18228
Unfortunately there's not much we can do here as we have to ask the method object where it exists and because you wrapped it the code object points to the decorator function and not the original method object.
I would also suggest you use the functools.wraps function to make sure your decorators look as much like the wrapped function as possible.
Activity
brettcannon commentedon Jan 5, 2022
Unfortunately there's not much we can do here as we have to ask the method object where it exists and because you wrapped it the code object points to the decorator function and not the original method object.
I would also suggest you use the
functools.wrapsfunction to make sure your decorators look as much like the wrapped function as possible.james10424 commentedon Jan 5, 2022
Brett Cannon (@brettcannon) Thank you for the suggestion, that solved the problem!
Add a test with decorator microsoft#18228