📌  相关文章
📜  解决 fastapi 错误 > assert message["type"] == "http.response.start" - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:07.509000             🧑  作者: Mango

代码示例1
import pytest


@pytest.mark.asyncio
async def test_middleware2():
    from async_asgi_testclient import TestClient

    async with TestClient(app) as client:
        response = await client.get("/")
        assert "X-Process-Time" in response.headers