Skip to content

Commit cb628ff

Browse files
committed
Print warnings caused by tests to stderr
If they are caught and we raise RuntimeError those warnings will not be visible anymore, which makes noticing and fixing them so much harder.
1 parent baf8afa commit cb628ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/async_wrapper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import warnings
3+
import sys
34

45

56

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

15+
for warn in warns:
16+
print(warn.message, file=sys.stderr)
17+
1418
if warns:
1519
raise RuntimeError
1620

0 commit comments

Comments
 (0)