From bbb08b8ba95fd66b6891c85d537b0e3f51f4daa6 Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 24 Jul 2021 22:22:40 +0100 Subject: [PATCH] Tidied API test code --- tests/test_openapi.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/test_openapi.py b/tests/test_openapi.py index 4e3a96c..a40f513 100644 --- a/tests/test_openapi.py +++ b/tests/test_openapi.py @@ -108,16 +108,13 @@ def dict_is_openapi(d): return True -def test_openapi_json_endpoint(thing): - c = thing.app.test_client() - r = c.get("/docs/openapi") +def test_openapi_json_endpoint(thing, client): + r = client.get("/docs/openapi") assert r.status_code == 200 assert dict_is_openapi(r.get_json()) -def test_openapi_yaml_endpoint(thing): - c = thing.app.test_client() - - r = c.get("/docs/openapi.yaml") +def test_openapi_yaml_endpoint(thing, client): + r = client.get("/docs/openapi.yaml") assert r.status_code == 200 assert dict_is_openapi(yaml.safe_load(r.data))