'Configure logging for pytest on a per-module basis
I have a pytest.ini file with the following contents:
[pytest]
log_level=WARN
log_cli_level=WARN
log_file_level=WARN
log_auto_indent=on
This works for turning off all logging that is below the warning level. Is there a way to turn up logging for a single module? Generally, I would like the module that I am actively debugging at info or debug, but the only way that I see to do that is manually set that in the code or replace all of the WARN with DEBUG, which gives me lots of output from modules I don't care about.
I found pytest: selective log levels on a per-module basis, which seems to indicate that you cannot do it from the CLI. Config files often offer more options (especially for something which could be as complicated as this) but I am not finding anything about it in the docs.
I am using python 3.7.6 and pytest 7.0.1, but am happy to upgrade to a newer stable version if that provides a good solution.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
