changes to addoption() for hyphenated long-options

--HG--
branch : opt-drop-non-hyphened-long-options
This commit is contained in:
Anthon van der Neut 2013-08-01 16:49:26 +02:00
parent e24b56af6c
commit e96da76c3b
7 changed files with 13 additions and 13 deletions

View File

@ -19,8 +19,8 @@ def pytest_addoption(parser):
to provide assert expression information. """) to provide assert expression information. """)
group.addoption('--no-assert', action="store_true", default=False, group.addoption('--no-assert', action="store_true", default=False,
dest="noassert", help="DEPRECATED equivalent to --assert=plain") dest="noassert", help="DEPRECATED equivalent to --assert=plain")
group.addoption('--nomagic', action="store_true", default=False, group.addoption('--nomagic', '--no-magic', action="store_true",
dest="nomagic", help="DEPRECATED equivalent to --assert=plain") default=False, help="DEPRECATED equivalent to --assert=plain")
class AssertionState: class AssertionState:
"""State for the assertion plugin.""" """State for the assertion plugin."""

View File

@ -13,8 +13,8 @@ def pytest_addoption(parser):
group._addoption('-p', action="append", dest="plugins", default = [], group._addoption('-p', action="append", dest="plugins", default = [],
metavar="name", metavar="name",
help="early-load given plugin (multi-allowed).") help="early-load given plugin (multi-allowed).")
group.addoption('--traceconfig', group.addoption('--traceconfig', '--trace-config',
action="store_true", dest="traceconfig", default=False, action="store_true", default=False,
help="trace considerations of conftest.py files."), help="trace considerations of conftest.py files."),
group.addoption('--debug', group.addoption('--debug',
action="store_true", dest="debug", default=False, action="store_true", dest="debug", default=False,

View File

@ -62,10 +62,10 @@ def bin_xml_escape(arg):
def pytest_addoption(parser): def pytest_addoption(parser):
group = parser.getgroup("terminal reporting") group = parser.getgroup("terminal reporting")
group.addoption('--junitxml', action="store", dest="xmlpath", group.addoption('--junitxml', '--junit-xml', action="store",
metavar="path", default=None, dest="xmlpath", metavar="path", default=None,
help="create junit-xml style report file at given path.") help="create junit-xml style report file at given path.")
group.addoption('--junitprefix', action="store", dest="junitprefix", group.addoption('--junitprefix', '--junit-prefix', action="store",
metavar="str", default=None, metavar="str", default=None,
help="prepend prefix to classnames in junit-xml output") help="prepend prefix to classnames in junit-xml output")

View File

@ -41,13 +41,14 @@ def pytest_addoption(parser):
help="run pytest in strict mode, warnings become errors.") help="run pytest in strict mode, warnings become errors.")
group = parser.getgroup("collect", "collection") group = parser.getgroup("collect", "collection")
group.addoption('--collectonly', group.addoption('--collectonly', '--collect-only', action="store_true",
action="store_true", dest="collectonly",
help="only collect tests, don't execute them."), help="only collect tests, don't execute them."),
group.addoption('--pyargs', action="store_true", group.addoption('--pyargs', action="store_true",
help="try to interpret all arguments as python packages.") help="try to interpret all arguments as python packages.")
group.addoption("--ignore", action="append", metavar="path", group.addoption("--ignore", action="append", metavar="path",
help="ignore path during collection (multi-allowed).") help="ignore path during collection (multi-allowed).")
# when changing this to --conf-cut-dir, config.py Conftest.setinitial
# needs upgrading as well
group.addoption('--confcutdir', dest="confcutdir", default=None, group.addoption('--confcutdir', dest="confcutdir", default=None,
metavar="dir", metavar="dir",
help="only load conftest.py's relative to specified dir.") help="only load conftest.py's relative to specified dir.")

View File

@ -6,7 +6,7 @@ import py
def pytest_addoption(parser): def pytest_addoption(parser):
group = parser.getgroup("terminal reporting", "resultlog plugin options") group = parser.getgroup("terminal reporting", "resultlog plugin options")
group.addoption('--resultlog', action="store", dest="resultlog", group.addoption('--resultlog', '--result-log', action="store",
metavar="path", default=None, metavar="path", default=None,
help="path for machine-readable result log.") help="path for machine-readable result log.")

View File

@ -27,8 +27,8 @@ def pytest_addoption(parser):
action="store", dest="tbstyle", default='long', action="store", dest="tbstyle", default='long',
choices=['long', 'short', 'no', 'line', 'native'], choices=['long', 'short', 'no', 'line', 'native'],
help="traceback print mode (long/short/line/native/no).") help="traceback print mode (long/short/line/native/no).")
group._addoption('--fulltrace', group._addoption('--fulltrace', '--full-trace',
action="store_true", dest="fulltrace", default=False, action="store_true", default=False,
help="don't cut any tracebacks (default is to cut).") help="don't cut any tracebacks (default is to cut).")
def pytest_configure(config): def pytest_configure(config):

View File

@ -267,7 +267,6 @@ def test_argcomplete(testdir, monkeypatch):
# argcomplete not found # argcomplete not found
pytest.skip("argcomplete not available") pytest.skip("argcomplete not available")
else: else:
#print 'type ---------------', result.stdout, result.stdout.lines
if py.std.sys.version_info < (2,7): if py.std.sys.version_info < (2,7):
result.stdout.lines = result.stdout.lines[0].split('\x0b') result.stdout.lines = result.stdout.lines[0].split('\x0b')
result.stdout.fnmatch_lines(["--funcargs", "--fulltrace"]) result.stdout.fnmatch_lines(["--funcargs", "--fulltrace"])