-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Simple example:

with --log-cli-level:

which incidentally happens to be the same as what you see with -v

I don't have any fixtures that modify logging settings or caplog or anything like that, nor anything that actually reads the value of --log-cli-level in my code, so I'm pretty sure this is a pytest issue.
I am not sure if this is intentional or not, I am leaning towards unintentional (hence why I am filing as a bug report) because there's no mention of this behaviour I can find in the documentation. If it is intentional, I struggle to understand why, I can't see a good reason to tie these two things together, clearly you can want to immediately log critical messages while still otherwise having a compact output. If it is one of those things that is how it is because things are simply built that way and it's not practical to rework, then fair enough, maybe at most there could be a mention somewhere.
- a detailed description of the bug or problem you are having
see above - output of
pip list
from the virtual environment you are using - pytest and operating system versions
- I spun up a new venv and confirmed this occurs identically with the only installed packages being the latest version of pytest and its dependencies. Observed on both WSL (Ubuntu 24.04.2 LTS) and Windows 11 Pro 24H2.
- minimal example if possible
- Works on the most minimal test possible: ie a single "test.py" file containing
def test_me():
assert True is True
and using pytest test.py
and pytest test.py --log-cli-level DEBUG