Skip to content

Commit

Permalink
Print warnings caused by tests to stderr
Browse files Browse the repository at this point in the history
If they are caught and we raise RuntimeError those warnings will not be
visible anymore, which makes noticing and fixing them so much harder.
  • Loading branch information
mweinelt committed Jan 5, 2025
1 parent cee2e09 commit f3b4f10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/async_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import warnings
import sys



Expand All @@ -11,6 +12,9 @@ def _await(coro):
ret = loop.run_until_complete(coro)
loop.close()

for warn in warns:
print(warn.message, file=sys.stderr)

if warns:
raise RuntimeError

Expand Down

0 comments on commit f3b4f10

Please sign in to comment.