Coverage for docs_src/tutorial/asyncify/tutorial002.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 01:12 +0000

1import time 1abcde

2 

3import anyio 1abcde

4from asyncer import asyncify 1abcde

5 

6 

7def do_sync_work(name: str): 1abcde

8 time.sleep(1) 1abcde

9 return f"Hello, {name}" 1abcde

10 

11 

12async def main(): 1abcde

13 message = await asyncify(do_sync_work)(name="World") 1abcde

14 print(message) 1abcde

15 

16 

17anyio.run(main) 1abcde