File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
import gc
2
+ import sys
2
3
from typing import List
3
4
4
5
import pytest
@@ -1253,6 +1254,14 @@ def test_plain_unittest_does_not_support_async(testdir):
1253
1254
"""
1254
1255
testdir .copy_example ("unittest/test_unittest_plain_async.py" )
1255
1256
result = testdir .runpytest_subprocess ()
1256
- result .stdout .fnmatch_lines (
1257
- ["*RuntimeWarning: coroutine * was never awaited" , "*1 passed*" ]
1258
- )
1257
+ if hasattr (sys , "pypy_version_info" ):
1258
+ # in PyPy we can't reliable get the warning about the coroutine not being awaited,
1259
+ # because it depends on the coroutine being garbage collected; given that
1260
+ # we are running in a subprocess, that's difficult to enforce
1261
+ expected_lines = ["*1 passed*" ]
1262
+ else :
1263
+ expected_lines = [
1264
+ "*RuntimeWarning: coroutine * was never awaited" ,
1265
+ "*1 passed*" ,
1266
+ ]
1267
+ result .stdout .fnmatch_lines (expected_lines )
You can’t perform that action at this time.
0 commit comments