call scanning of plugins directly, code is shifted from helpconfig.py to core.py

This commit is contained in:
holger krekel
2014-10-01 12:20:11 +02:00
parent 3de715ec13
commit 351931d5ca
6 changed files with 119 additions and 132 deletions
-22
View File
@@ -164,28 +164,6 @@ class FSHookProxy(object):
self.__dict__[name] = x
return x
hookmethod = getattr(self.config.hook, name)
methods = self.config.pluginmanager.listattr(name, plugins=plugins)
self.__dict__[name] = x = HookCaller(hookmethod, methods)
return x
class HookCaller:
def __init__(self, hookmethod, methods):
self.hookmethod = hookmethod
self.methods = methods
def __call__(self, **kwargs):
return self.hookmethod._docall(self.methods, kwargs)
def callextra(self, methods, **kwargs):
# XXX in theory we should respect "tryfirst/trylast" if set
# on the added methods but we currently only use it for
# pytest_generate_tests and it doesn't make sense there i'd think
all = self.methods
if methods:
all = all + methods
return self.hookmethod._docall(all, kwargs)
def compatproperty(name):
def fget(self):