adapt for current API changes of pluggy
--HG-- branch : pluggy1
This commit is contained in:
parent
920b5afe45
commit
88538f13ba
|
@ -133,10 +133,11 @@ class PytestPluginManager(PluginManager):
|
||||||
self.trace.root.setwriter(err.write)
|
self.trace.root.setwriter(err.write)
|
||||||
self.enable_tracing()
|
self.enable_tracing()
|
||||||
|
|
||||||
def get_hookimpl_opts(self, plugin, name):
|
def parse_hookimpl_opts(self, method):
|
||||||
method = getattr(plugin, name)
|
opts = super(PytestPluginManager, self).parse_hookimpl_opts(method)
|
||||||
opts = super(PytestPluginManager, self).get_hookimpl_opts(plugin, name)
|
|
||||||
if opts is None:
|
if opts is None:
|
||||||
|
name = getattr(method, "__name__", None)
|
||||||
|
if name is not None:
|
||||||
if name.startswith("pytest_") and not exclude_pytest_names(name):
|
if name.startswith("pytest_") and not exclude_pytest_names(name):
|
||||||
opts = {}
|
opts = {}
|
||||||
opts["tryfirst"] = hasattr(method, "tryfirst")
|
opts["tryfirst"] = hasattr(method, "tryfirst")
|
||||||
|
@ -145,8 +146,8 @@ class PytestPluginManager(PluginManager):
|
||||||
opts["hookwrapper"] = hasattr(method, "hookwrapper")
|
opts["hookwrapper"] = hasattr(method, "hookwrapper")
|
||||||
return opts
|
return opts
|
||||||
|
|
||||||
def get_hookspec_opts(self, module_or_class, name):
|
def parse_hookspec_opts(self, module_or_class, name):
|
||||||
opts = super(PytestPluginManager, self).get_hookspec_opts(module_or_class, name)
|
opts = super(PytestPluginManager, self).parse_hookspec_opts(module_or_class, name)
|
||||||
if opts is None:
|
if opts is None:
|
||||||
if name.startswith("pytest_"):
|
if name.startswith("pytest_"):
|
||||||
meth = getattr(module_or_class, name)
|
meth = getattr(module_or_class, name)
|
||||||
|
|
Loading…
Reference in New Issue