()
| 105 | |
| 106 | @asynccontextmanager |
| 107 | async def auto_refresh_client() -> AsyncIterator[ClientSession]: |
| 108 | async with ClientSession() as session: |
| 109 | ready = asyncio.Event() |
| 110 | t = asyncio.create_task(set_token(session, ready)) |
| 111 | await ready.wait() |
| 112 | yield session |
| 113 | t.cancel() |
| 114 | with suppress(asyncio.CancelledError): |
| 115 | await t |
| 116 | |
| 117 | async with auto_refresh_client() as sess: |
| 118 | ... |
no test coverage detected
searching dependent graphs…