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

9 statements  

« prev     ^ index     » next       coverage.py v7.17.2, created at 2026-12-05 11:30 +0000

1# 🚨 Don't use this, it will block the event loop! 🚨 

2 

3import time 1abcdefghijk

4 

5import anyio 1abcdefghijk

6 

7 

8def do_sync_work(name: str): 1abcdefghijk

9 time.sleep(1) 1abcdefghijk

10 return f"Hello, {name}" 1abcdefghijk

11 

12 

13async def main(): 1abcdefghijk

14 message = do_sync_work(name="World") 1abcdefghijk

15 print(message) 1abcdefghijk

16 

17 

18anyio.run(main) 1abcdefghijk