can use non-underscored addoption

This commit is contained in:
Benjamin Peterson 2011-05-26 23:15:33 -05:00
parent 606ea870f0
commit 5f75c5851f
1 changed files with 7 additions and 8 deletions

View File

@ -19,7 +19,7 @@ else:
def pytest_addoption(parser):
group = parser.getgroup("debugconfig")
group._addoption('--assertmode', action="store", dest="assertmode",
group.addoption('--assertmode', action="store", dest="assertmode",
choices=("on", "old", "off", "default"), default="default",
metavar="on|old|off",
help="""control assertion debugging tools.
@ -27,11 +27,10 @@ def pytest_addoption(parser):
'old' reinterprets the expressions in asserts to glean information.
'on' (the default) rewrites the assert statements in test modules to provide
sub-expression results.""")
group._addoption('--no-assert', action="store_true", default=False,
group.addoption('--no-assert', action="store_true", default=False,
dest="noassert", help="DEPRECATED equivalent to --assertmode=off")
group._addoption('--nomagic', action="store_true", default=False,
dest="nomagic",
help="DEPRECATED equivalent to --assertmode=off")
group.addoption('--nomagic', action="store_true", default=False,
dest="nomagic", help="DEPRECATED equivalent to --assertmode=off")
class AssertionState:
"""State for the assertion plugin."""