diff options
| author | bd <bdunahu@operationnull.com> | 2025-07-21 12:53:59 -0600 |
|---|---|---|
| committer | bd <bdunahu@operationnull.com> | 2025-07-21 12:53:59 -0600 |
| commit | 83e88319b72df01fa70e6bf3a020ab745cdef661 (patch) | |
| tree | cf53f7bed1a12036365343b393ea448153003b75 /t/task_groups_and_cancel.py | |
| parent | 1eddfd07cad491ce8d216ee3fda72bdd9ecb9eae (diff) | |
Adapt the rest of the existing test to unit tests
Diffstat (limited to 't/task_groups_and_cancel.py')
| -rw-r--r-- | t/task_groups_and_cancel.py | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/t/task_groups_and_cancel.py b/t/task_groups_and_cancel.py deleted file mode 100644 index dcc6bbe..0000000 --- a/t/task_groups_and_cancel.py +++ /dev/null @@ -1,35 +0,0 @@ -import asyncio - - -async def sleep(): - await asyncio.sleep(3) - print('I should never finish!') - return 0 - - -async def work(): - i = 0 - while i < 50: - i += 1 - await asyncio.sleep(0.2) - return 0 - - -async def explode(): - await asyncio.sleep(1.5) - a = 1 / 0 - return a - - -async def main(): - # exploding will bring all other tasks down with it! - try: - async with asyncio.TaskGroup() as tg: - tg.create_task(sleep()) - tg.create_task(work()) - tg.create_task(explode()) - except: - pass - - -asyncio.run(main()) |
