Opened 9 years ago

Last modified 9 years ago

#4144 enhancement new

TestCase.flushWarnings cannot identify warnings which affect decorated functions

Reported by: Jean-Paul Calderone Owned by:
Priority: normal Milestone:
Component: trial Keywords:
Cc: Branch:


For example, consider a function decorated with inlineCallbacks. Passing such a function to flushWarnings results in it flushing all the warnings which apply to the nested unwindGenerator function defined inside inlineCallbacks.

It would be nice if flushWarnings could find the proper function. Perhaps this could be done by looking for an attribute on the decorated function which refers to the original. I'm not sure what would happen if two layers of decoration are applied, though.

Change History (2)

comment:1 Changed 9 years ago by Jean-Paul Calderone

For what it's worth, I ran into this while working on #970. A deferredGenerator, twisted.names.root.discoverAuthority, calls a deprecated function. I wanted to flush the warning from that function, but couldn't, so I ended up using the suppress attribute of the test method instead.

comment:2 Changed 7 years ago by <automation>

Owner: Jonathan Lange deleted
Note: See TracTickets for help on using tickets.