(self)
| 2265 | ) |
| 2266 | |
| 2267 | async def test_custom_context(self) -> None: |
| 2268 | ctxvar = ContextVar[int]("ctxvar") |
| 2269 | ctx = copy_context() |
| 2270 | ctx.run(ctxvar.set, 42) |
| 2271 | |
| 2272 | async def taskfunc() -> int: |
| 2273 | return ctxvar.get() |
| 2274 | |
| 2275 | assert ctxvar.get(None) is None |
| 2276 | async with create_task_group() as tg: |
| 2277 | assert await tg.create_task(taskfunc(), context=ctx) == 42 |
| 2278 | |
| 2279 | async def test_task_name_default(self) -> None: |
| 2280 | async def taskfunc() -> str | None: |
nothing calls this directly
no test coverage detected