[Twisted-Python] Getting deprecation warnings?

Hey, What is the appropriate way to run twistd apps in such a way that I get nice and loud deprecation warnings? I ran into an issue with one of my apps with the new release because t.w.error.NoResource is now t.w.resource.NoResource, I would like to make my code as forward compatible as possible as we go along, of course :) (Actually this issue was because I stole some non-released code from #4173, which wasn't being tested, but the not being tested part is now fixed.) -- cheers lvh

On 06:41 pm, _@lvh.cc wrote:
1) Have complete unit test coverage and run your tests with trial. All deprecation warnings will be written out as part of the test suite run. 2) Run twistd with Python 2.6 3) Run twistd with Python 2.7 and pass "-W::DeprecationWarning:" Jean-Paul

On Sep 5, 2012, at 12:11 PM, exarkun@twistedmatrix.com wrote:
A note for posterity - if we are ever to implement a generalized 'run an inferior twistd process', or even 'run an inferior python interpreter' mechanism, warning information like this is one of the bits of runtime state that ought to be communicated. -glyph

On Sep 5, 2012, at 1:08 PM, exarkun@twistedmatrix.com wrote:
Yeah, that's kinda why I specifically pointed it out. There are a number of command-line arguments which we should preserve if we can, but some (python -u, I think?) are lost to us entirely. Warning disposition though, is especially important, given that users might be running subprocesses and we should report warnings in code that is covered that way too. -glyph

Huh. I have complete unit test coverage and was using trial, but somehow I managed to miss that... I guess I will have to pay more attention or something?! I will try to recreate a situation where the warnings should pop up. Thanks! On Wed, Sep 5, 2012 at 9:11 PM, <exarkun@twistedmatrix.com> wrote:
-- cheers lvh

On 06:41 pm, _@lvh.cc wrote:
1) Have complete unit test coverage and run your tests with trial. All deprecation warnings will be written out as part of the test suite run. 2) Run twistd with Python 2.6 3) Run twistd with Python 2.7 and pass "-W::DeprecationWarning:" Jean-Paul

On Sep 5, 2012, at 12:11 PM, exarkun@twistedmatrix.com wrote:
A note for posterity - if we are ever to implement a generalized 'run an inferior twistd process', or even 'run an inferior python interpreter' mechanism, warning information like this is one of the bits of runtime state that ought to be communicated. -glyph

On Sep 5, 2012, at 1:08 PM, exarkun@twistedmatrix.com wrote:
Yeah, that's kinda why I specifically pointed it out. There are a number of command-line arguments which we should preserve if we can, but some (python -u, I think?) are lost to us entirely. Warning disposition though, is especially important, given that users might be running subprocesses and we should report warnings in code that is covered that way too. -glyph

Huh. I have complete unit test coverage and was using trial, but somehow I managed to miss that... I guess I will have to pay more attention or something?! I will try to recreate a situation where the warnings should pop up. Thanks! On Wed, Sep 5, 2012 at 9:11 PM, <exarkun@twistedmatrix.com> wrote:
-- cheers lvh
participants (3)
-
exarkun@twistedmatrix.com
-
Glyph
-
Laurens Van Houtven