(coro)
| 45 | |
| 46 | # Test async function is detected and run with asyncio.run |
| 47 | def close_coroutine(coro): |
| 48 | coro.close() |
| 49 | return "mocked_async" |
| 50 | |
| 51 | with patch("asyncio.run", side_effect=close_coroutine) as mock_run: |
| 52 | result = persistent_wrapper.call_method(real_async_func, []) |