httpx/tests/concurrency.py
Adrian Garcia Badaracco 16e2830624
use # pragma: no cover instead of # pragma: nocover (#2471)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-11-29 10:23:18 -06:00

16 lines
324 B
Python

"""
Async environment-agnostic concurrency utilities that are only used in tests.
"""
import asyncio
import sniffio
import trio
async def sleep(seconds: float) -> None:
if sniffio.current_async_library() == "trio":
await trio.sleep(seconds) # pragma: no cover
else:
await asyncio.sleep(seconds)