remove deprecated parser.addgroup usage in favour of getgroup
--HG-- branch : trunk
This commit is contained in:
		
							parent
							
								
									fb159b0d40
								
							
						
					
					
						commit
						a161a865c8
					
				|  | @ -8,7 +8,7 @@ py.test.importorskip("figleaf.annotate_html") | ||||||
| import figleaf | import figleaf | ||||||
| 
 | 
 | ||||||
| def pytest_addoption(parser): | def pytest_addoption(parser): | ||||||
|     group = parser.addgroup('figleaf options') |     group = parser.getgroup('figleaf options') | ||||||
|     group.addoption('-F', action='store_true', default=False, |     group.addoption('-F', action='store_true', default=False, | ||||||
|             dest = 'figleaf', |             dest = 'figleaf', | ||||||
|             help=('trace python coverage with figleaf and write HTML ' |             help=('trace python coverage with figleaf and write HTML ' | ||||||
|  |  | ||||||
|  | @ -7,7 +7,7 @@ import py | ||||||
| pylint = py.test.importorskip("pylint.lint")  | pylint = py.test.importorskip("pylint.lint")  | ||||||
| 
 | 
 | ||||||
| def pytest_addoption(parser): | def pytest_addoption(parser): | ||||||
|     group = parser.addgroup('pylint options') |     group = parser.getgroup('pylint options') | ||||||
|     group.addoption('--pylint', action='store_true', |     group.addoption('--pylint', action='store_true', | ||||||
|                     default=False, dest='pylint', |                     default=False, dest='pylint', | ||||||
|                     help='run pylint on python files.') |                     help='run pylint on python files.') | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ import py | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| def pytest_addoption(parser): | def pytest_addoption(parser): | ||||||
|     group = parser.addgroup("ReST", "ReST documentation check options") |     group = parser.getgroup("ReST", "ReST documentation check options") | ||||||
|     group.addoption('-R', '--urlcheck', |     group.addoption('-R', '--urlcheck', | ||||||
|            action="store_true", dest="urlcheck", default=False,  |            action="store_true", dest="urlcheck", default=False,  | ||||||
|            help="urlopen() remote links found in ReST text files.")  |            help="urlopen() remote links found in ReST text files.")  | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ import py | ||||||
| from py.builtin import print_ | from py.builtin import print_ | ||||||
| 
 | 
 | ||||||
| def pytest_addoption(parser): | 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, |     group.addoption('--resultlog', action="store", dest="resultlog", metavar="path", default=None, | ||||||
|            help="path for machine-readable result log.") |            help="path for machine-readable result log.") | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ import py | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def pytest_addoption(parser): | def pytest_addoption(parser): | ||||||
|     grp = parser.addgroup("testserver options")  |     grp = parser.getgroup("testserver options")  | ||||||
|     grp.addoption("--url", action="store", default=None, |     grp.addoption("--url", action="store", default=None, | ||||||
|         help="url for testserver")  |         help="url for testserver")  | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ class TestConfigCmdlineParsing: | ||||||
|     def test_parser_addoption_default_env(self, testdir, monkeypatch): |     def test_parser_addoption_default_env(self, testdir, monkeypatch): | ||||||
|         import os |         import os | ||||||
|         config = testdir.Config() |         config = testdir.Config() | ||||||
|         group = config._parser.addgroup("hello") |         group = config._parser.getgroup("hello") | ||||||
| 
 | 
 | ||||||
|         monkeypatch.setitem(os.environ, 'PYTEST_OPTION_OPTION1', 'True') |         monkeypatch.setitem(os.environ, 'PYTEST_OPTION_OPTION1', 'True') | ||||||
|         group.addoption("--option1", action="store_true") |         group.addoption("--option1", action="store_true") | ||||||
|  |  | ||||||
|  | @ -89,7 +89,7 @@ class TestConfigPickling: | ||||||
|     def test_config_pickling_customoption(self, testdir): |     def test_config_pickling_customoption(self, testdir): | ||||||
|         testdir.makeconftest(""" |         testdir.makeconftest(""" | ||||||
|             def pytest_addoption(parser): |             def pytest_addoption(parser): | ||||||
|                 group = parser.addgroup("testing group") |                 group = parser.getgroup("testing group") | ||||||
|                 group.addoption('-G', '--glong', action="store", default=42,  |                 group.addoption('-G', '--glong', action="store", default=42,  | ||||||
|                     type="int", dest="gdest", help="g value.") |                     type="int", dest="gdest", help="g value.") | ||||||
|         """) |         """) | ||||||
|  | @ -109,7 +109,7 @@ class TestConfigPickling: | ||||||
|         tmp.ensure("__init__.py") |         tmp.ensure("__init__.py") | ||||||
|         tmp.join("conftest.py").write(py.code.Source(""" |         tmp.join("conftest.py").write(py.code.Source(""" | ||||||
|             def pytest_addoption(parser): |             def pytest_addoption(parser): | ||||||
|                 group = parser.addgroup("testing group") |                 group = parser.getgroup("testing group") | ||||||
|                 group.addoption('-G', '--glong', action="store", default=42,  |                 group.addoption('-G', '--glong', action="store", default=42,  | ||||||
|                     type="int", dest="gdest", help="g value.") |                     type="int", dest="gdest", help="g value.") | ||||||
|         """)) |         """)) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue