From 0c961deeaab13a91f94832e0cd124b7fce722f5c Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sun, 26 Apr 2015 00:22:34 +0200 Subject: [PATCH] fix some doc strings --HG-- branch : more_plugin --- _pytest/config.py | 5 ++--- _pytest/core.py | 15 ++++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/_pytest/config.py b/_pytest/config.py index ff05f3184..bb0d07962 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -118,7 +118,7 @@ class PytestPluginManager(PluginManager): self.trace.root.setwriter(err.write) self.enable_tracing() - def register(self, plugin, name=None, conftest=False): + def register(self, plugin, name=None): ret = super(PytestPluginManager, self).register(plugin, name) if ret: self.hook.pytest_plugin_registered.call_historic( @@ -263,8 +263,7 @@ class PytestPluginManager(PluginManager): self.import_plugin(arg) def consider_conftest(self, conftestmodule): - if self.register(conftestmodule, name=conftestmodule.__file__, - conftest=True): + if self.register(conftestmodule, name=conftestmodule.__file__): self.consider_module(conftestmodule) def consider_env(self): diff --git a/_pytest/core.py b/_pytest/core.py index acd7044b0..82b9416ed 100644 --- a/_pytest/core.py +++ b/_pytest/core.py @@ -203,9 +203,8 @@ class PluginManager(object): plugin objects. An optional excludefunc allows to blacklist names which are not considered as hooks despite a matching prefix. - For debugging purposes you can call ``set_tracing(writer)`` - which will subsequently send debug information to the specified - write function. + For debugging purposes you can call ``enable_tracing()`` + which will subsequently send debug information to the trace helper. """ def __init__(self, prefix, excludefunc=None): @@ -219,6 +218,8 @@ class PluginManager(object): MultiCall(methods, kwargs, hook.firstresult).execute() def _hookexec(self, hook, methods, kwargs): + # called from all hookcaller instances. + # enable_tracing will set its own wrapping function at self._inner_hookexec return self._inner_hookexec(hook, methods, kwargs) def enable_tracing(self): @@ -237,9 +238,9 @@ class PluginManager(object): return TracedHookExecution(self, before, after).undo def subset_hook_caller(self, name, remove_plugins): - """ Return a new HookCaller instance which manages calls to - the plugins but without hooks from the plugins in remove_plugins - taking part. """ + """ Return a new HookCaller instance for the named method + which manages calls to all registered plugins except the + ones from remove_plugins. """ hc = getattr(self.hook, name) plugins_to_remove = [plugin for plugin in remove_plugins if hasattr(plugin, name)] @@ -496,7 +497,7 @@ class HookCaller(object): hc.argnames = self.argnames hc.firstresult = self.firstresult # we keep track of this hook caller so it - # gets properly removed on plugin unregistration + # gets properly pruned on plugin unregistration self._subcaller.append(hc) return hc