On Fri, 2010-08-06 at 17:49 +0100, Chris Withers wrote:
> 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
> > http://plope.com/Members/chrism/logging_blues 
> 
> You want LogCapture:
> http://packages.python.org/testfixtures/logging.html

That looks useful for things that do use getLogger and for people who
have problems mocking up loggers.  But FIWW, I don't really have a
problem mocking up the debug logger in the BFG unit tests and I can't
think up a case where I want to assert anything about what gets sent to
it except in its own unit tests.

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

I have.  It hurt bad.  See this scar above my eye on my forehead?
<points>...

- C

_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to