Skip to content

Commit bbb08b8

Browse files
committed
Tidied API test code
1 parent 23c720a commit bbb08b8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/test_openapi.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,13 @@ def dict_is_openapi(d):
108108
return True
109109

110110

111-
def test_openapi_json_endpoint(thing):
112-
c = thing.app.test_client()
113-
r = c.get("/docs/openapi")
111+
def test_openapi_json_endpoint(thing, client):
112+
r = client.get("/docs/openapi")
114113
assert r.status_code == 200
115114
assert dict_is_openapi(r.get_json())
116115

117116

118-
def test_openapi_yaml_endpoint(thing):
119-
c = thing.app.test_client()
120-
121-
r = c.get("/docs/openapi.yaml")
117+
def test_openapi_yaml_endpoint(thing, client):
118+
r = client.get("/docs/openapi.yaml")
122119
assert r.status_code == 200
123120
assert dict_is_openapi(yaml.safe_load(r.data))

0 commit comments

Comments
 (0)