Is the value of the log_cli
ini option introspectable from conftest.py
?
#12702
Answered
by
wimglenn
adigitoleo
asked this question in
Q&A
-
If not, why is that the case? My use case is that I handle "live logging" using a custom logging plugin and want to override In particular, I'm looking to get the value of that option with something like: @pytest.hookimpl(trylast=True)
def pytest_configure(config):
if config.option.log_cli_option:
# Suppress default live logs, turn on my custom variant |
Beta Was this translation helpful? Give feedback.
Answered by
wimglenn
Aug 9, 2024
Replies: 1 comment 3 replies
-
Yes, take a look at if your [tool.pytest.ini_options]
log_cli = true Then your
You may also be interested in |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
adigitoleo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, take a look at
config.getini
.if your
pyproject.toml
has this:Then your
conftest.py
can have this:You may also be interested in
config.getoption
, for retrieving command-line options (these have precedence over ini options).