From 971ebcbd776a122d6785a73476e727c8eade0336 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 28 Sep 2015 15:43:55 +0200 Subject: [PATCH] simplify by removing the single-call "exclude_pytest_names" function --- _pytest/config.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/_pytest/config.py b/_pytest/config.py index c327436ad..8be167a21 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -120,12 +120,6 @@ def _prepareconfig(args=None, plugins=None): raise -def exclude_pytest_names(name): - return not name.startswith(name) or name == "pytest_plugins" or \ - name.startswith("pytest_funcarg__") - - - class PytestPluginManager(PluginManager): """ Overwrites :py:class:`pluggy.PluginManager` to add pytest-specific @@ -171,14 +165,14 @@ class PytestPluginManager(PluginManager): return self.add_hookspecs(module_or_class) def parse_hookimpl_opts(self, plugin, name): - if exclude_pytest_names(name): - return None - # pytest hooks are always prefixed with pytest_ # so we avoid accessing possibly non-readable attributes # (see issue #1073) if not name.startswith("pytest_"): return + # ignore some historic special names which can not be hooks anyway + if name == "pytest_plugins" or name.startswith("pytest_funcarg__"): + return method = getattr(plugin, name) opts = super(PytestPluginManager, self).parse_hookimpl_opts(plugin, name)