From 87de06a124474ce71f1702faede161c7a77a9ce5 Mon Sep 17 00:00:00 2001 From: hpk Date: Sat, 21 Mar 2009 16:17:30 +0100 Subject: [PATCH] [svn r63190] no resultlog plugin by default have custom options come last in "py.test -h" --HG-- branch : trunk --- py/test/defaultconftest.py | 3 +-- py/test/plugin/pytest_resultlog.py | 5 +++-- py/test/pytestplugin.py | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/py/test/defaultconftest.py b/py/test/defaultconftest.py index 2ffdedc42..a83eb41f4 100644 --- a/py/test/defaultconftest.py +++ b/py/test/defaultconftest.py @@ -10,8 +10,7 @@ Instance = py.test.collect.Instance conf_iocapture = "fd" # overridable from conftest.py -# XXX resultlog should go, pypy's nightrun depends on it -pytest_plugins = "default terminal xfail tmpdir execnetcleanup resultlog monkeypatch".split() +pytest_plugins = "default terminal xfail tmpdir execnetcleanup monkeypatch".split() # =================================================== # settings in conftest only (for now) - for distribution diff --git a/py/test/plugin/pytest_resultlog.py b/py/test/plugin/pytest_resultlog.py index 76abad5c5..2f8d3358d 100644 --- a/py/test/plugin/pytest_resultlog.py +++ b/py/test/plugin/pytest_resultlog.py @@ -5,8 +5,9 @@ class ResultlogPlugin: Useful for buildbot integration code. """ def pytest_addoption(self, parser): - parser.addoption('--resultlog', action="store", dest="resultlog", - help="path for machine-readable result log") + group = parser.addgroup("resultlog", "resultlog plugin options") + group.addoption('--resultlog', action="store", dest="resultlog", metavar="path", + help="path for machine-readable result log.") def pytest_configure(self, config): resultlog = config.option.resultlog diff --git a/py/test/pytestplugin.py b/py/test/pytestplugin.py index 115a90cc5..51d524058 100644 --- a/py/test/pytestplugin.py +++ b/py/test/pytestplugin.py @@ -78,7 +78,9 @@ class PytestPlugins(object): return self.pyplugins.notify(eventname, *args, **kwargs) def do_addoption(self, parser): - self.pyplugins.call_each('pytest_addoption', parser=parser) + methods = self.pyplugins.listattr("pytest_addoption", reverse=True) + mc = py._com.MultiCall(methods, parser=parser) + mc.execute() def pyevent_plugin_registered(self, plugin): if hasattr(self, '_config'):