All of Python & FastAPIPython & FastAPI
Testing
pytest, fixtures, async tests and flaky suites.
2 articles
Python & FastAPI9 min read
pytest-asyncio 'event loop is already running': there is no patch coming
request.getfixturevalue() on an async fixture crashes pytest-asyncio, nest_asyncio no longer saves you, and upstream has no fix. Here is the test architecture that works instead.
Read
Python & FastAPI6 min read
Pydantic v2 'MockValSer object cannot be converted to SchemaSerializer': The Real Cause
This cryptic Pydantic v2 TypeError means your model schema never finished building, usually an unresolved forward reference. Here is the fix, not a workaround.
Read