(capsys)
| 418 | |
| 419 | @pytest.mark.skipif(sys.version_info < (3, 5, 3), reason="Coroutine can't access running loop") |
| 420 | def test_enqueue_coroutine_loop(capsys): |
| 421 | with new_event_loop_context() as loop: |
| 422 | logger.add(async_writer, enqueue=True, loop=loop, format="{message}", catch=False) |
| 423 | |
| 424 | async def worker(): |
| 425 | logger.info("A") |
| 426 | await logger.complete() |
| 427 | |
| 428 | loop.run_until_complete(worker()) |
| 429 | |
| 430 | out, err = capsys.readouterr() |
| 431 | assert out == "A\n" |
| 432 | assert err == "" |
| 433 | |
| 434 | |
| 435 | def test_enqueue_coroutine_from_inside_coroutine_without_loop(capsys): |
nothing calls this directly
no test coverage detected