Add --overwrite-ini ININAME=INIVALUE cli option#1667
Add --overwrite-ini ININAME=INIVALUE cli option#1667hpk42 merged 1 commit intopytest-dev:featuresfrom
Conversation
|
@blueyed please help review |
|
Did you check if there are existing commandline options which we now could maybe deprecate? |
CHANGELOG.rst
Outdated
| * New cli flag ``--override-ini`` or ``-o`` that overrides ini values from the | ||
| command line so that one can do e.g. "-o xfail_strict=True". This is useful for | ||
| specifying options for which there is no separate command-line flag, a complete | ||
| ini-options can be showed by py.test --help |
There was a problem hiding this comment.
i'd make a "." after flag. and then say "The complete list of ini-options can be shown by py.test --help". Mind the escape of the command which is important for rendering the docs.
_pytest/config.py
Outdated
| value = None | ||
| if self.getoption("override_ini", None): | ||
| for ini_config in self.option.override_ini: | ||
| (key, user_ini_value) = ini_config.split("=", 2) |
There was a problem hiding this comment.
I think maxsplit needs to be 1
There was a problem hiding this comment.
Thanks a lot. Good catch!
f5a90ab to
77104d6
Compare
|
amended the commit to fix issues |
77104d6 to
18725e6
Compare
| "ini2:url=/tmp/user2?a=b&d=e", | ||
| "ini3:True", | ||
| "ini4:False" | ||
| ]) No newline at end of file |
There was a problem hiding this comment.
i think we also need a test for multiple -o options -- they all should get applied. So e.g.
-o custom_option1=yes -o custom_option2=no.
There was a problem hiding this comment.
Rewrited the testcase to use multiple -o
27c77d6 to
9c48bb7
Compare
|
will rebase on features branch |
9c48bb7 to
3f623e4
Compare
3f623e4 to
7bc4cc8
Compare
Signed-off-by: Ted Xiao <xiao.xj@gmail.com>
7bc4cc8 to
856e6ca
Compare
|
thanks! |
support for "--overwrite-ini ININAME=INIVALUE" to overrides ini values from the command line
so that one can do e.g. "-o xfail_strict=True".