ImperialCollegeLondon / ImperialCollegeLondon/virtual_ecosystem
Change global `pytest` logging level to `INFO`
- Dominant language
- Python
- Stars
- 20
- Forks
- 5
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 34
Description
**Is your feature request related to a problem? Please describe.**
As @alexdewar pointed out we currently test for a lot of `DEBUG` level logging output. I can see the argument against doing this as the `DEBUG` logging level is basically used to hide information that would otherwise clutter up the logging output, which makes the expected log tests pretty long and convoluted. And also `DEBUG` logging messages are only likely to be of interest to us as developers.
**Describe the solution you'd like**
We could set to the `pytest` logging to `INFO` so that `DEBUG` messages do not end up in the `caplog` fixture. We would then have to remove `DEBUG` messages from our expected logs for tests.
**Describe alternatives you've considered**
The `pytest` logging level does have to be set globally otherwise you get inconsistent behaviour when `pytest` is run on the whole repo vs run on individual files. That means the only real options are to set the level to `DEBUG`, `INFO`, `WARNING`, or `ERROR`. I feel like `INFO` is the most sensible unless others disagree.
Contributor guide
Research direction
Start by locating the repository-wide pytest logging configuration and the tests using the caplog fixture. Update the global level to INFO, remove DEBUG entries from expected logs, and run the affected tests and full pytest suite to confirm logging expectations remain consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100