[py-svn] pytest commit e7083ff9d8ef: show traces for all hook invocations not just "path/node" based ones

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Nov 6 19:44:53 CET 2010


# HG changeset patch -- Bitbucket.org
# Project pytest
# URL http://bitbucket.org/hpk42/pytest/overview
# User holger krekel <holger at merlinux.eu>
# Date 1289069184 -3600
# Node ID e7083ff9d8efeb354f4b5bdfff77158802a1aa06
# Parent  5f89191fcd0a77727f9c8e5a3a73f8cc2e964e31
show traces for all hook invocations not just "path/node" based ones

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



More information about the pytest-commit mailing list