(pytester: Pytester)
| 1185 | |
| 1186 | @pytest.mark.filterwarnings("default::pytest.PytestUnhandledCoroutineWarning") |
| 1187 | def test_warn_on_async_gen_function(pytester: Pytester) -> None: |
| 1188 | pytester.makepyfile( |
| 1189 | test_async=""" |
| 1190 | async def test_1(): |
| 1191 | yield |
| 1192 | async def test_2(): |
| 1193 | yield |
| 1194 | def test_3(): |
| 1195 | return test_2() |
| 1196 | """ |
| 1197 | ) |
| 1198 | result = pytester.runpytest() |
| 1199 | result.stdout.fnmatch_lines( |
| 1200 | [ |
| 1201 | "test_async.py::test_1", |
| 1202 | "test_async.py::test_2", |
| 1203 | "test_async.py::test_3", |
| 1204 | "*async def functions are not natively supported*", |
| 1205 | "*3 skipped, 3 warnings in*", |
| 1206 | ] |
| 1207 | ) |
| 1208 | # ensure our warning message appears only once |
| 1209 | assert ( |
| 1210 | result.stdout.str().count("async def functions are not natively supported") == 1 |
| 1211 | ) |
| 1212 | |
| 1213 | |
| 1214 | def test_pdb_can_be_rewritten(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected