enhance debug tracing: print trace tags at the end of message and forget about "prefix".

Always log to "pytestdebug.log" if "--debug" option is given.
also move related code to pytest_helpconfig plugin.
This commit is contained in:
holger krekel
2011-07-14 19:11:50 +02:00
parent ade9b9aa8e
commit 650c3bcfde
7 changed files with 46 additions and 27 deletions
+1 -2
View File
@@ -8,8 +8,6 @@ import pytest
def pytest_cmdline_parse(pluginmanager, args):
config = Config(pluginmanager)
config.parse(args)
if config.option.debug:
config.trace.root.setwriter(sys.stderr.write)
return config
def pytest_unconfigure(config):
@@ -334,6 +332,7 @@ class Config(object):
# Note that this can only be called once per testing process.
assert not hasattr(self, 'args'), (
"can only parse cmdline args at most once per Config object")
self._origargs = args
self._preparse(args)
self._parser.hints.extend(self.pluginmanager._hints)
args = self._parser.parse_setoption(args, self.option)