-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --overwrite-ini ININAME=INIVALUE cli option #1667
Conversation
@blueyed please help review |
Did you check if there are existing commandline options which we now could maybe deprecate? |
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maxsplit needs to be 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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".