[TIP] nose and the Python logging module

Kumar McMillan kumar.mcmillan at gmail.com
Thu Aug 28 17:14:34 PDT 2008

On Thu, Aug 28, 2008 at 2:54 PM, Brad Allen <bradallen137 at gmail.com> wrote:
> "The logging module problem cropped up when converting an existing unit
> test suite over to nose: the code tested an application that used the
> logging module, and reconfigured logging so that nose's output didn't
> show up.
> [...]
> Is this still an issue? I am thinking about trying out nose, but I don't
> want to waste any time if I'm going to run into the same problem that
> tripped up Titus. The app I want to write tests for makes heavy use of
> the Python logging module.

Hi Brad.
The issue above might be have been due to the timing of when logging
was setup in a test and when nose was imported (since nose configures
logging upon its import).  A possible workaround would be to make sure
nose is imported before all other modules.

If your app does use logging heavily, however, I'd recommend waiting
until nose 0.11 has been released before you start using it since
there is currently a lot of work being done on a plugin to deal with
the Mess That is Logging ;)

Star 148 if you want to follow the progress

More information about the testing-in-python mailing list