reshuffle/refine option grouping, introduce "terminal reporting options"
--HG-- branch : trunk
This commit is contained in:
parent
80f3e33e41
commit
c38bb72205
|
@ -89,11 +89,11 @@ import os
|
|||
|
||||
def pytest_addoption(parser):
|
||||
group = parser.getgroup("general")
|
||||
group._addoption('-s', action="store_const", const="no", dest="capture",
|
||||
help="shortcut for --capture=no.")
|
||||
group._addoption('--capture', action="store", default=None,
|
||||
metavar="method", type="choice", choices=['fd', 'sys', 'no'],
|
||||
help="set capturing method during tests: fd (default)|sys|no.")
|
||||
group._addoption('-s', action="store_const", const="no", dest="capture",
|
||||
help="shortcut for --capture=no.")
|
||||
|
||||
def addouterr(rep, outerr):
|
||||
repr = getattr(rep, 'longrepr', None)
|
||||
|
|
|
@ -44,9 +44,7 @@ def pytest_report_iteminfo(item):
|
|||
return item.reportinfo()
|
||||
|
||||
def pytest_addoption(parser):
|
||||
group = parser.getgroup("general", "general testing options")
|
||||
group._addoption('-v', '--verbose', action="count",
|
||||
dest="verbose", default=0, help="increase verbosity."),
|
||||
group = parser.getgroup("general", "running and selection options")
|
||||
group._addoption('-x', '--exitfirst',
|
||||
action="store_true", dest="exitfirst", default=False,
|
||||
help="exit instantly on first error or failed test."),
|
||||
|
@ -56,16 +54,6 @@ def pytest_addoption(parser):
|
|||
"space separated keywords. precede a keyword with '-' to negate. "
|
||||
"Terminate the expression with ':' to treat a match as a signal "
|
||||
"to run all subsequent tests. ")
|
||||
group._addoption('-l', '--showlocals',
|
||||
action="store_true", dest="showlocals", default=False,
|
||||
help="show locals in tracebacks (disabled by default).")
|
||||
#group._addoption('--showskipsummary',
|
||||
# action="store_true", dest="showskipsummary", default=False,
|
||||
# help="always show summary of skipped tests")
|
||||
group._addoption('--tb', metavar="style",
|
||||
action="store", dest="tbstyle", default='long',
|
||||
type="choice", choices=['long', 'short', 'no'],
|
||||
help="traceback verboseness (long/short/no).")
|
||||
group._addoption('-p', action="append", dest="plugins", default = [],
|
||||
help=("load the specified plugin after command line parsing. "))
|
||||
if execnet:
|
||||
|
|
|
@ -7,6 +7,23 @@ import py
|
|||
import sys
|
||||
|
||||
def pytest_addoption(parser):
|
||||
group = parser.getgroup("terminal reporting", after="general")
|
||||
group._addoption('-v', '--verbose', action="count",
|
||||
dest="verbose", default=0, help="increase verbosity."),
|
||||
group._addoption('-l', '--showlocals',
|
||||
action="store_true", dest="showlocals", default=False,
|
||||
help="show locals in tracebacks (disabled by default).")
|
||||
group.addoption('--report',
|
||||
action="store", dest="report", default=None, metavar="opts",
|
||||
help="comma separated reporting options")
|
||||
group._addoption('--tb', metavar="style",
|
||||
action="store", dest="tbstyle", default='long',
|
||||
type="choice", choices=['long', 'short', 'no'],
|
||||
help="traceback verboseness (long/short/no).")
|
||||
group._addoption('--fulltrace',
|
||||
action="store_true", dest="fulltrace", default=False,
|
||||
help="don't cut any tracebacks (default is to cut).")
|
||||
|
||||
group = parser.getgroup("debugconfig")
|
||||
group.addoption('--collectonly',
|
||||
action="store_true", dest="collectonly",
|
||||
|
@ -17,15 +34,9 @@ def pytest_addoption(parser):
|
|||
group._addoption('--nomagic',
|
||||
action="store_true", dest="nomagic", default=False,
|
||||
help="don't reinterpret asserts, no traceback cutting. ")
|
||||
group._addoption('--fulltrace',
|
||||
action="store_true", dest="fulltrace", default=False,
|
||||
help="don't cut any tracebacks (default is to cut).")
|
||||
group.addoption('--debug',
|
||||
action="store_true", dest="debug", default=False,
|
||||
help="generate and show debugging information.")
|
||||
group.addoption('--report',
|
||||
action="store", dest="report", default=None, metavar="opts",
|
||||
help="comma separated reporting options")
|
||||
help="generate and show internal debugging information.")
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
Changes between 1.0.2 and '1.1.0b1'
|
||||
=====================================
|
||||
|
||||
* reshuffle / refine command line grouping
|
||||
|
||||
* deprecate parser.addgroup in favour of getgroup which creates option group
|
||||
|
||||
* add --report command line option that allows to control showing of skipped/xfailed sections
|
||||
|
|
Loading…
Reference in New Issue