Improve test debugging (#1222)

This commit is contained in:
Samuel Colvin
2020-04-08 05:37:38 +01:00
committed by GitHub
parent 483bce3ae1
commit e9b189e9f2
144 changed files with 434 additions and 434 deletions

View File

@@ -113,7 +113,7 @@ openapi_schema = {
def test_openapi_schema():
with TestClient(app) as client:
response = client.get("/openapi.json")
assert response.status_code == 200
assert response.status_code == 200, response.text
assert response.json() == openapi_schema
@@ -121,11 +121,11 @@ def test_create_read():
with TestClient(app) as client:
note = {"text": "Foo bar", "completed": False}
response = client.post("/notes/", json=note)
assert response.status_code == 200
assert response.status_code == 200, response.text
data = response.json()
assert data["text"] == note["text"]
assert data["completed"] == note["completed"]
assert "id" in data
response = client.get(f"/notes/")
assert response.status_code == 200
assert response.status_code == 200, response.text
assert data in response.json()