show traces for all hook invocations not just "path/node" based ones

This commit is contained in:
holger krekel 2010-11-06 19:46:24 +01:00
parent fcebf4f557
commit 1899443744
1 changed files with 5 additions and 4 deletions

View File

@ -94,7 +94,6 @@ class PluginManager(object):
self._name2plugin[name] = plugin self._name2plugin[name] = plugin
self.call_plugin(plugin, "pytest_addhooks", {'pluginmanager': self}) self.call_plugin(plugin, "pytest_addhooks", {'pluginmanager': self})
self.hook.pytest_plugin_registered(manager=self, plugin=plugin) self.hook.pytest_plugin_registered(manager=self, plugin=plugin)
self.trace("registered", plugin)
if not prepend: if not prepend:
self._plugins.append(plugin) self._plugins.append(plugin)
else: else:
@ -380,13 +379,15 @@ class HookCaller:
def __call__(self, **kwargs): def __call__(self, **kwargs):
methods = self.hookrelay._pm.listattr(self.name) methods = self.hookrelay._pm.listattr(self.name)
mc = MultiCall(methods, kwargs, firstresult=self.firstresult) return self._docall(methods, kwargs)
return mc.execute()
def pcall(self, plugins, **kwargs): def pcall(self, plugins, **kwargs):
methods = self.hookrelay._pm.listattr(self.name, plugins=plugins)
return self._docall(methods, kwargs)
def _docall(self, methods, kwargs):
self.trace(self.name, kwargs) self.trace(self.name, kwargs)
self.trace.root.indent += 1 self.trace.root.indent += 1
methods = self.hookrelay._pm.listattr(self.name, plugins=plugins)
mc = MultiCall(methods, kwargs, firstresult=self.firstresult) mc = MultiCall(methods, kwargs, firstresult=self.firstresult)
res = mc.execute() res = mc.execute()
if res: if res: