Provide better logging for unit test runs in sbws
When I tried to figure out why my patch for legacy/trac#33009 (moved) did suddenly stall some unit test I got confused as I assumed all the log statements in the code would be shown during the test run. That is I thought I could be sure that logging output not shown meant the code paths were not touched. I was wrong.
Even though some DEBUG logs are shown during the test run this does not hold for every DEBUG log (the former are available thanks to caplog
fixture in some tests).
I think it is worth getting this confusion fixed e.g. by providing an easy knob to tune the debug output for tests to the needs of the dev. One thing juga pointed out to me is creating a pytest.ini
file in the root of the project containing something like
[pytest]
log_cli=true
log_cli_level=DEBUG
which would show debug output for all tests.
Additionally, we should write some documentation explaining these things.