better error reporting in graphql tests

This commit is contained in:
Houkime 2023-12-06 13:57:39 +00:00
parent 1a65545c29
commit 2e59e7e880

View file

@ -25,7 +25,13 @@ def assert_empty(response):
def assert_data(response):
assert response.status_code == 200
data = response.json().get("data")
response = response.json()
if (
"errors" in response.keys()
): # convenience for debugging, this will display error
raise ValueError(response["errors"])
data = response.get("data")
assert data is not None
return data