Browse Source

Fix coverage for `docs_src.path_params.tutorial003b`

pull/14569/head
Yurii Motov 7 months ago
parent
commit
f24f82bb06
  1. 8
      tests/test_tutorial/test_path_params/test_tutorial003b.py

8
tests/test_tutorial/test_path_params/test_tutorial003b.py

@ -1,6 +1,8 @@
import asyncio
from fastapi.testclient import TestClient
from docs_src.path_params.tutorial003b_py39 import app
from docs_src.path_params.tutorial003b_py39 import app, read_users2
client = TestClient(app)
@ -11,6 +13,10 @@ def test_get_users():
assert response.json() == ["Rick", "Morty"]
def test_read_users2(): # Just for coverage
assert asyncio.run(read_users2()) == ["Bean", "Elfo"]
def test_openapi_schema():
response = client.get("/openapi.json")
assert response.status_code == 200, response.text

Loading…
Cancel
Save