Opened 5 years ago

Last modified 5 years ago

#4144 enhancement new

TestCase.flushWarnings cannot identify warnings which affect decorated functions

Reported by: exarkun Owned by:
Priority: normal Milestone:
Component: trial Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description

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 5 years ago by exarkun

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 3 years ago by <automation>

  • Owner jml deleted
Note: See TracTickets for help on using tickets.