[TIP] nose and the Python logging module

C. Titus Brown ctb at msu.edu
Thu Aug 28 13:13:01 PDT 2008


On Thu, Aug 28, 2008 at 02:54:16PM -0500, Brad Allen wrote:
-> Titus Brown's introductory article about nose, last edited in 2006, 
-> mentions a caveat about using nose to test apps that use the Python 
-> logging module:
-> 
->  <http://ivory.idyll.org/articles/nose-intro.html#what-are-unit-tests>
-> 
-> "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. This frustrated my attempts to trace test discovery to no end 
-> -- as far as I could tell, nose was simply stopping test discovery at a 
-> certain point! I doubt there's a general solution to this, but I thought 
-> I'd mention it."
-> 
-> 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.

hey Brad,

I think if you are aware of the problem and have properly configured
logging so that nose logging doesn't get swept up in your app's
logging, you won't have any problems.

Hmm, I should really update that... <sigh>

cheers,
--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the testing-in-python mailing list