Chris McDonough wrote:
> Calling getLogger results in an *atexit* hook related to a handler being
> registered for the current Python process.  It might also, depending on
> its mood, print to stdout.  These things make it miserable to actually
> unit test any application which calls getLogger.  See also

You want LogCapture:

Admittedly, I hadn't noticed the atexit hook getting added, but I've 
never been bitten by it..

> That said, you can pass in a logger instance to the Configurator as a
> debug logger (as the debug_logger parameter) if you need to replace it
> to capture logging output of BFG itself during a "unit test" (more
> likely a functional test really).

Yep, certainly functional tests...


Simplistix - Content Management, Batch Processing & Python Consulting
Repoze-dev mailing list

Reply via email to