Created
July 20, 2022 12:20
-
-
Save graingert/ea2546b23b32be5a4493a9a115db2eff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
async def main(): | |
try: | |
async with asyncio.timeout(0): | |
await asyncio.sleep(0) | |
except TimeoutError: | |
print("PASS: great a timeout is here!") | |
else: | |
print("FAILED: expected a timeout") | |
try: | |
async with asyncio.timeout(0): | |
await asyncio.sleep(0) | |
await asyncio.sleep(0) | |
except TimeoutError: | |
print("PASS: great a timeout is here!") | |
else: | |
print("FAILED: expected a timeout") | |
asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
prints: