better error reporting in graphql tests

remove-rest
Houkime 2023-12-06 13:57:39 +00:00
parent 1a65545c29
commit 2e59e7e880
1 changed files with 7 additions and 1 deletions

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