python-async-timeout: update to 5.0.1

Update package to 5.0.1.

Add PYPI_SOURCE_NAME since PyPI switched sdist filename to use
underscores (async_timeout-5.0.1.tar.gz).

Add test.sh to verify timeout context manager functionality.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
Alexandru Ardelean
2026-04-04 23:29:17 +03:00
committed by Alexandru Ardelean
parent 9785dc89ec
commit 2b8992a144
2 changed files with 37 additions and 3 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
[ "$1" = python3-async-timeout ] || exit 0
python3 - << 'EOF'
import asyncio
import async_timeout
async def test_no_timeout():
async with async_timeout.timeout(10):
await asyncio.sleep(0)
print("no_timeout OK")
async def test_timeout_fires():
try:
async with async_timeout.timeout(0.01):
await asyncio.sleep(1)
assert False, "Should have timed out"
except asyncio.TimeoutError:
print("timeout_fires OK")
async def test_timeout_none():
async with async_timeout.timeout(None):
await asyncio.sleep(0)
print("timeout_none OK")
async def main():
await test_no_timeout()
await test_timeout_fires()
await test_timeout_none()
asyncio.run(main())
EOF