simplify tracing mechanics by simply going through an indirection

--HG--
branch : more_plugin
This commit is contained in:
holger krekel
2015-04-25 18:15:39 +02:00
parent 9c5495832c
commit 1e883f5979
5 changed files with 74 additions and 170 deletions

View File

@@ -34,13 +34,15 @@ def pytest_cmdline_parse():
pytest.__version__, py.__version__,
".".join(map(str, sys.version_info)),
os.getcwd(), config._origargs))
config.pluginmanager.set_tracing(debugfile.write)
config.trace.root.setwriter(debugfile.write)
undo_tracing = config.pluginmanager.enable_tracing()
sys.stderr.write("writing pytestdebug information to %s\n" % path)
def unset_tracing():
debugfile.close()
sys.stderr.write("wrote pytestdebug information to %s\n" %
debugfile.name)
config.trace.root.setwriter(None)
undo_tracing()
config.add_cleanup(unset_tracing)
def pytest_cmdline_main(config):