Closed simonw closed 2 years ago
Here's a diff that fixes the tests in 3.6 (and breaks them elsewhere):
diff --git a/tests/test_graphql.py b/tests/test_graphql.py
index dcbe8bd..77e70cb 100644
--- a/tests/test_graphql.py
+++ b/tests/test_graphql.py
@@ -557,20 +557,25 @@ async def test_num_queries_limit(db_path):
"data": {
"users": {
"nodes": [
+ {"id": 1, "name": "cleopaws", "repos_list": None},
{
- "id": 1,
- "name": "cleopaws",
- "repos_list": {"nodes": [{"full_name": "cleopaws/dogspotter"}]},
+ "id": 2,
+ "name": "simonw",
+ "repos_list": {
+ "nodes": [
+ {"full_name": "simonw/datasette"},
+ {"full_name": "simonw/private"},
+ ]
+ },
},
- {"id": 2, "name": "simonw", "repos_list": None},
]
}
},
"errors": [
{
- "message": "Query limit exceeded: 3 > 2 - /test/repos.json?_nofacet=1&_size=10&owner=2",
+ "message": "Query limit exceeded: 3 > 2 - /test/repos.json?_nofacet=1&_size=10&owner=1",
"locations": [{"line": 7, "column": 17}],
- "path": ["users", "nodes", 1, "repos_list"],
+ "path": ["users", "nodes", 0, "repos_list"],
}
],
}
The difference is that repos_list
now comes back empty for Cleo and populated for Simon, whereas in other versions it comes back empty for Simon and populated for Cleo.
I'm updating the test so it passes provided at least one user has an empty repos_list
and the error message starts with the correct text.
Tests pass on other Pythons, fail on 3.6 here: https://github.com/simonw/datasette-graphql/runs/4241305026?check_suite_focus=true