add --override-ini option to overrides ini values

Signed-off-by: Ted Xiao <xiao.xj@gmail.com>
This commit is contained in:
Ted Xiao
2016-06-25 22:12:42 +08:00
parent 13a188fe37
commit 856e6cab75
5 changed files with 124 additions and 8 deletions

View File

@@ -20,6 +20,10 @@ def pytest_addoption(parser):
group.addoption('--debug',
action="store_true", dest="debug", default=False,
help="store internal tracing debug information in 'pytestdebug.log'.")
# support for "--overwrite-ini ININAME=INIVALUE" to override values from the ini file
# Example '-o xfail_strict=True'.
group._addoption('-o', '--override-ini', nargs='*', dest="override_ini", action="append",
help="overrides ini values which do not have a separate command-line flag")
@pytest.hookimpl(hookwrapper=True)