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 _______________________________________________ py-dev mailing list py-dev@codespeak.net http://codespeak.net/mailman/listinfo/py-dev