From f38c8161604a7588dad05dc0a513672940677ea1 Mon Sep 17 00:00:00 2001 From: Yerassyl Zhanymkanov Date: Fri, 19 Aug 2022 01:37:02 +0600 Subject: [PATCH] Add example for calling async test client --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 38dff63..d9eff01 100644 --- a/README.md +++ b/README.md @@ -522,6 +522,13 @@ async def client(): app, scope=scope, headers={"X-User-Fingerprint": "Test"} ) as client: yield client + + +@pytest.mark.asyncio +async def test_create_post(client: TestClient): + resp = await client.post("/posts") + + assert resp.status_code == 201 ``` Unless you have sync db connection (excuse me?) or aren't planning to write integration tests. ### 16. Set postgres identity from day 0