From a161a865c8fe5b3c0525e763b962d8adf0f6859b Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 27 Oct 2009 10:03:11 +0100 Subject: [PATCH] remove deprecated parser.addgroup usage in favour of getgroup --HG-- branch : trunk --- _py/test/plugin/pytest_figleaf.py | 2 +- _py/test/plugin/pytest_pylint.py | 2 +- _py/test/plugin/pytest_restdoc.py | 2 +- _py/test/plugin/pytest_resultlog.py | 2 +- example/funcarg/urloption/conftest.py | 2 +- testing/pytest/test_config.py | 2 +- testing/pytest/test_pickling.py | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/_py/test/plugin/pytest_figleaf.py b/_py/test/plugin/pytest_figleaf.py index ed4d7bb7c..4af711001 100644 --- a/_py/test/plugin/pytest_figleaf.py +++ b/_py/test/plugin/pytest_figleaf.py @@ -8,7 +8,7 @@ py.test.importorskip("figleaf.annotate_html") import figleaf def pytest_addoption(parser): - group = parser.addgroup('figleaf options') + group = parser.getgroup('figleaf options') group.addoption('-F', action='store_true', default=False, dest = 'figleaf', help=('trace python coverage with figleaf and write HTML ' diff --git a/_py/test/plugin/pytest_pylint.py b/_py/test/plugin/pytest_pylint.py index 698828af3..b2656ff7e 100644 --- a/_py/test/plugin/pytest_pylint.py +++ b/_py/test/plugin/pytest_pylint.py @@ -7,7 +7,7 @@ import py pylint = py.test.importorskip("pylint.lint") def pytest_addoption(parser): - group = parser.addgroup('pylint options') + group = parser.getgroup('pylint options') group.addoption('--pylint', action='store_true', default=False, dest='pylint', help='run pylint on python files.') diff --git a/_py/test/plugin/pytest_restdoc.py b/_py/test/plugin/pytest_restdoc.py index 2013b8dc5..296ca95e7 100644 --- a/_py/test/plugin/pytest_restdoc.py +++ b/_py/test/plugin/pytest_restdoc.py @@ -5,7 +5,7 @@ import py import sys def pytest_addoption(parser): - group = parser.addgroup("ReST", "ReST documentation check options") + group = parser.getgroup("ReST", "ReST documentation check options") group.addoption('-R', '--urlcheck', action="store_true", dest="urlcheck", default=False, help="urlopen() remote links found in ReST text files.") diff --git a/_py/test/plugin/pytest_resultlog.py b/_py/test/plugin/pytest_resultlog.py index 5a981bda0..abbf92a4d 100644 --- a/_py/test/plugin/pytest_resultlog.py +++ b/_py/test/plugin/pytest_resultlog.py @@ -6,7 +6,7 @@ import py from py.builtin import print_ def pytest_addoption(parser): - group = parser.addgroup("resultlog", "resultlog plugin options") + group = parser.getgroup("resultlog", "resultlog plugin options") group.addoption('--resultlog', action="store", dest="resultlog", metavar="path", default=None, help="path for machine-readable result log.") diff --git a/example/funcarg/urloption/conftest.py b/example/funcarg/urloption/conftest.py index 439bcf569..5f7bc846e 100644 --- a/example/funcarg/urloption/conftest.py +++ b/example/funcarg/urloption/conftest.py @@ -3,7 +3,7 @@ import py def pytest_addoption(parser): - grp = parser.addgroup("testserver options") + grp = parser.getgroup("testserver options") grp.addoption("--url", action="store", default=None, help="url for testserver") diff --git a/testing/pytest/test_config.py b/testing/pytest/test_config.py index c5142a420..4793ba310 100644 --- a/testing/pytest/test_config.py +++ b/testing/pytest/test_config.py @@ -23,7 +23,7 @@ class TestConfigCmdlineParsing: def test_parser_addoption_default_env(self, testdir, monkeypatch): import os config = testdir.Config() - group = config._parser.addgroup("hello") + group = config._parser.getgroup("hello") monkeypatch.setitem(os.environ, 'PYTEST_OPTION_OPTION1', 'True') group.addoption("--option1", action="store_true") diff --git a/testing/pytest/test_pickling.py b/testing/pytest/test_pickling.py index 64dc479e8..08392ae0a 100644 --- a/testing/pytest/test_pickling.py +++ b/testing/pytest/test_pickling.py @@ -89,7 +89,7 @@ class TestConfigPickling: def test_config_pickling_customoption(self, testdir): testdir.makeconftest(""" def pytest_addoption(parser): - group = parser.addgroup("testing group") + group = parser.getgroup("testing group") group.addoption('-G', '--glong', action="store", default=42, type="int", dest="gdest", help="g value.") """) @@ -109,7 +109,7 @@ class TestConfigPickling: tmp.ensure("__init__.py") tmp.join("conftest.py").write(py.code.Source(""" def pytest_addoption(parser): - group = parser.addgroup("testing group") + group = parser.getgroup("testing group") group.addoption('-G', '--glong', action="store", default=42, type="int", dest="gdest", help="g value.") """))