introduce plugin discovery through setuptools "pytest11" entrypoints

and refine execnet dependency handling.  Prepare 1.1 release

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-11-23 17:20:36 +01:00
parent 0e03ae1ee8
commit ed03eef81b
7 changed files with 128 additions and 17 deletions

View File

@@ -77,6 +77,14 @@ class PluginManager(object):
for spec in self._envlist("PYTEST_PLUGINS"):
self.import_plugin(spec)
def consider_setuptools_entrypoints(self):
from pkg_resources import iter_entry_points
for ep in iter_entry_points('pytest11'):
if ep.name in self._name2plugin:
continue
plugin = ep.load()
self.register(plugin, name=ep.name)
def consider_preparse(self, args):
for opt1,opt2 in zip(args, args[1:]):
if opt1 == "-p":