Re: mocking a logging object

2008-06-02 Thread Peter Bengtsson
On Jun 2, 12:34 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Peter Bengtsson wrote: > > In my unittest I want to override the logger of a working module so > > that it puts all logging messages in /tmp/test.log instead so that in > > my unittest I can inspect that it logs things correctly. H

Re: mocking a logging object

2008-06-02 Thread Peter Bengtsson
On Jun 2, 12:34 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Peter Bengtsson wrote: > > In my unittest I want to override the logger of a working module so > > that it puts all logging messages in /tmp/test.log instead so that in > > my unittest I can inspect that it logs things correctly. H

Re: mocking a logging object

2008-06-02 Thread Diez B. Roggisch
Peter Bengtsson wrote: > In my unittest I want to override the logger of a working module so > that it puts all logging messages in /tmp/test.log instead so that in > my unittest I can inspect that it logs things correctly. Hopefully > this "pseudo" code will explain my problem:: > import lo

mocking a logging object

2008-06-02 Thread Peter Bengtsson
In my unittest I want to override the logger of a working module so that it puts all logging messages in /tmp/test.log instead so that in my unittest I can inspect that it logs things correctly. Hopefully this "pseudo" code will explain my problem:: >>> import logging, os >>> logging.basicConfig(f