-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Asyncio warning and error log messages should be displayed #8760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related: It would be great if |
unfortunately I believe this would need a hack or a PEP to get solved -- this is similar to the problem here is pytest has no control over the event loop creation -- that's being created by the test code itself -- perhaps something like |
@asottile With asyncio we can register the handler whenever a new loop is created. The following in
Would something like this fit into pytest itself? I see the need for it independent of whether the actual test functions are async. In the example above Without handler being set, asyncio logs the exception as |
I also updated the description above to reflect the proposal more clearly. |
Closing this because I think it's best solved in |
An exception in an asyncio loop callback leads to an error message being logged by asyncio. Given that the test does not fail, this log message is not displayed, except if
log_cli
is enabled (see below). However, this leads to log messages from all loggers to be printed.I think there should be an easy way to enable log messages for asyncio of warning and above and/or these should be visible by default.
Proposal
--pdb
registers an exception handler for post-mortem debugging of loop callback exceptionsMWE
setup.cfg
info
The text was updated successfully, but these errors were encountered: