[py-dev] 1.0.0b8 out

holger krekel holger at merlinux.eu
Thu Jul 23 21:23:29 CEST 2009


On Thu, Jul 23, 2009 at 19:52 +0200, holger krekel wrote:
> On Thu, Jul 23, 2009 at 12:04 +1000, Gordon Wrigley wrote:
> > Alas I'm still getting logging issues, specifically I get a big slab
> > of this every time a test fails
> > 
> > Traceback (most recent call last):
> >   File "/usr/lib/python2.6/logging/__init__.py", line 769, in emit
> >     stream.write(fs % msg)
> > ValueError: I/O operation on closed file
> 
> hum, py.test does not do anything with logging itself. 
> But it captures stdout/stderr during setup, test-call
> and teardown to temporary files/StringIOs.  It properly 
> closes the temporary files/streams at each of the
> three phases.  Do you have a single logging configuration
> during setup/call/teardown, mabe? 

that seems to be the issue, here is one way to reproduce it: 

        import logging
        def setup_module(mod):
            logging.warn("hello world")

        def test_logging():
            logging.warn("hello world")
            assert 0

need to think some more about this and maybe look more
into the logging module and its assumtions. 

holger



More information about the Pytest-dev mailing list