Posts Tagged: asyncio
-
asyncio vs Multiprocessing for CPU-Bound Tasks: When GIL Removal in Python 3.13 Free-Threaded Matters
Compare asyncio and multiprocessing performance for CPU-bound tasks like fibonacci and matrix multiplication. Benchmarks on Python 3.12 vs 3.13 free-threaded show multiprocessing's edge and how no-GIL threading closes the gap.
-
Using pytest Fixtures with FastAPI TestClient for Database Transaction Rollbacks
FastAPI pytest fixtures TestClient database transaction rollbacks: Isolate tests, zero data pollution. SQLAlchemy async sessions, pytest-asyncio override dependency. 500+ tests/s clean state. Code examples, conftest.py fixture, session.begin()/rollback(). Keywords: 'fastapi pytest database testing', 'fastapi testclient fixtures rollback', 'pytest fastapi sqlalchemy transaction rollback', 'fastapi testing isolation', 'pytest fixtures testclient'.