From e96da76c3b5c8cf4a7766930db708c1fd5865ee8 Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Thu, 1 Aug 2013 16:49:26 +0200 Subject: [PATCH] changes to addoption() for hyphenated long-options --HG-- branch : opt-drop-non-hyphened-long-options --- _pytest/assertion/__init__.py | 4 ++-- _pytest/helpconfig.py | 4 ++-- _pytest/junitxml.py | 6 +++--- _pytest/main.py | 5 +++-- _pytest/resultlog.py | 2 +- _pytest/terminal.py | 4 ++-- testing/test_parseopt.py | 1 - 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/_pytest/assertion/__init__.py b/_pytest/assertion/__init__.py index bd3b594fd..ec841e7c0 100644 --- a/_pytest/assertion/__init__.py +++ b/_pytest/assertion/__init__.py @@ -19,8 +19,8 @@ def pytest_addoption(parser): to provide assert expression information. """) group.addoption('--no-assert', action="store_true", default=False, dest="noassert", help="DEPRECATED equivalent to --assert=plain") - group.addoption('--nomagic', action="store_true", default=False, - dest="nomagic", help="DEPRECATED equivalent to --assert=plain") + group.addoption('--nomagic', '--no-magic', action="store_true", + default=False, help="DEPRECATED equivalent to --assert=plain") class AssertionState: """State for the assertion plugin.""" diff --git a/_pytest/helpconfig.py b/_pytest/helpconfig.py index 08bd9f720..048863869 100644 --- a/_pytest/helpconfig.py +++ b/_pytest/helpconfig.py @@ -13,8 +13,8 @@ def pytest_addoption(parser): group._addoption('-p', action="append", dest="plugins", default = [], metavar="name", help="early-load given plugin (multi-allowed).") - group.addoption('--traceconfig', - action="store_true", dest="traceconfig", default=False, + group.addoption('--traceconfig', '--trace-config', + action="store_true", default=False, help="trace considerations of conftest.py files."), group.addoption('--debug', action="store_true", dest="debug", default=False, diff --git a/_pytest/junitxml.py b/_pytest/junitxml.py index cac51b55b..503d8606b 100644 --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -62,10 +62,10 @@ def bin_xml_escape(arg): def pytest_addoption(parser): group = parser.getgroup("terminal reporting") - group.addoption('--junitxml', action="store", dest="xmlpath", - metavar="path", default=None, + group.addoption('--junitxml', '--junit-xml', action="store", + dest="xmlpath", metavar="path", default=None, 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, help="prepend prefix to classnames in junit-xml output") diff --git a/_pytest/main.py b/_pytest/main.py index 6a39cb3bc..de3a43822 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -41,13 +41,14 @@ def pytest_addoption(parser): help="run pytest in strict mode, warnings become errors.") group = parser.getgroup("collect", "collection") - group.addoption('--collectonly', - action="store_true", dest="collectonly", + group.addoption('--collectonly', '--collect-only', action="store_true", help="only collect tests, don't execute them."), group.addoption('--pyargs', action="store_true", help="try to interpret all arguments as python packages.") group.addoption("--ignore", action="append", metavar="path", 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, metavar="dir", help="only load conftest.py's relative to specified dir.") diff --git a/_pytest/resultlog.py b/_pytest/resultlog.py index 892a880b3..d7f37a53c 100644 --- a/_pytest/resultlog.py +++ b/_pytest/resultlog.py @@ -6,7 +6,7 @@ import py def pytest_addoption(parser): 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, help="path for machine-readable result log.") diff --git a/_pytest/terminal.py b/_pytest/terminal.py index 4be2078d1..5a1e877ec 100644 --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -27,8 +27,8 @@ def pytest_addoption(parser): action="store", dest="tbstyle", default='long', choices=['long', 'short', 'no', 'line', 'native'], help="traceback print mode (long/short/line/native/no).") - group._addoption('--fulltrace', - action="store_true", dest="fulltrace", default=False, + group._addoption('--fulltrace', '--full-trace', + action="store_true", default=False, help="don't cut any tracebacks (default is to cut).") def pytest_configure(config): diff --git a/testing/test_parseopt.py b/testing/test_parseopt.py index d91bf335e..e80de59ac 100644 --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -267,7 +267,6 @@ def test_argcomplete(testdir, monkeypatch): # argcomplete not found pytest.skip("argcomplete not available") else: - #print 'type ---------------', result.stdout, result.stdout.lines if py.std.sys.version_info < (2,7): result.stdout.lines = result.stdout.lines[0].split('\x0b') result.stdout.fnmatch_lines(["--funcargs", "--fulltrace"])