Open zefciu opened 2 years ago
from the https://github.com/pytest-dev/pytest/issues/9119 i take the stance that aiologgewr is reponsible and uses a logging setup antipattern (which is to set up handlers at module/library level instead of the application startup
Is there a workaround to make the tests work successfully without the -s flag?
Is there any solution for this?
To reproduce this bug, use the following code:
After running pytest we get:
Note that if running pytest with the
-s
switch, the test passes. The issue is therefore with the pytest stdout capturing being incompatible with aiologger’s stream handler.Because I’m not 100% sure, which side should really handle the issue, I will post the same ticket on both pytest and aiologger page.