We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents eced536 + c8cfff6 commit f76ac4cCopy full SHA for f76ac4c
testing/acceptance_test.py
@@ -1160,14 +1160,19 @@ def test_usage_error_code(testdir):
1160
1161
@pytest.mark.filterwarnings("default")
1162
def test_warn_on_async_function(testdir):
1163
+ # In the below we .close() the coroutine only to avoid
1164
+ # "RuntimeWarning: coroutine 'test_2' was never awaited"
1165
+ # which messes with other tests.
1166
testdir.makepyfile(
1167
test_async="""
1168
async def test_1():
1169
pass
1170
async def test_2():
1171
1172
def test_3():
- return test_2()
1173
+ coro = test_2()
1174
+ coro.close()
1175
+ return coro
1176
"""
1177
)
1178
result = testdir.runpytest()
0 commit comments