Closed simonw closed 3 years ago
from graphql.execution.executors.asyncio import AsyncioExecutor
36
E ModuleNotFoundError: No module named 'graphql.execution.executors'
Looks like Schema
has a new async def execute_async
method.
Failing tests are:
=================================== FAILURES ===================================
_________________________ test_graphql_examples[path1] _________________________
ds = <datasette.app.Datasette object at 0x7ff46d943b10>
path = PosixPath('/home/runner/work/datasette-graphql/datasette-graphql/examples/sort_desc.md')
@pytest.mark.asyncio
@pytest.mark.parametrize(
"path", (pathlib.Path(__file__).parent.parent / "examples").glob("*.md")
)
async def test_graphql_examples(ds, path):
content = path.read_text()
query = graphql_re.search(content)[1]
try:
variables = variables_re.search(content)[1]
except TypeError:
variables = "{}"
expected = json.loads(json_re.search(content)[1])
response = await ds.client.post(
"/graphql",
json={
"query": query,
"variables": json.loads(variables),
},
)
> assert response.status_code == 200, response.json()
E AssertionError: {'data': {'users': None}, 'errors': [{'locations': [{'column': 5, 'line': 3}], 'message': "<usersSortDesc.points: 'points'>", 'path': ['users']}]}
E assert 500 == 200
E + where 500 = <Response [500 Internal Server Error]>.status_code
tests/test_graphql.py:143: AssertionError
________________________ test_graphql_examples[path13] _________________________
ds = <datasette.app.Datasette object at 0x7ff46d943b10>
path = PosixPath('/home/runner/work/datasette-graphql/datasette-graphql/examples/related.md')
@pytest.mark.asyncio
@pytest.mark.parametrize(
"path", (pathlib.Path(__file__).parent.parent / "examples").glob("*.md")
)
async def test_graphql_examples(ds, path):
content = path.read_text()
query = graphql_re.search(content)[1]
try:
variables = variables_re.search(content)[1]
except TypeError:
variables = "{}"
expected = json.loads(json_re.search(content)[1])
response = await ds.client.post(
"/graphql",
json={
"query": query,
"variables": json.loads(variables),
},
)
> assert response.status_code == 200, response.json()
E AssertionError: {'data': {'licenses_with_repos': {'nodes': [{'name': 'Apache 2', 'repos_list': {'nodes': [...]}}, {'name': 'MIT', 'rep...n': 13, 'line': 25}], 'message': "<reposSort.id: 'id'>", 'path': ['users_with_dogspotter', 'nodes', 1, 'repos_list']}]}
E assert 500 == 200
E + where 500 = <Response [500 Internal Server Error]>.status_code
tests/test_graphql.py:143: AssertionError
________________________ test_graphql_examples[path14] _________________________
ds = <datasette.app.Datasette object at 0x7ff46d943b10>
path = PosixPath('/home/runner/work/datasette-graphql/datasette-graphql/examples/sort.md')
@pytest.mark.asyncio
@pytest.mark.parametrize(
"path", (pathlib.Path(__file__).parent.parent / "examples").glob("*.md")
)
async def test_graphql_examples(ds, path):
content = path.read_text()
query = graphql_re.search(content)[1]
try:
variables = variables_re.search(content)[1]
except TypeError:
variables = "{}"
expected = json.loads(json_re.search(content)[1])
response = await ds.client.post(
"/graphql",
json={
"query": query,
"variables": json.loads(variables),
},
)
> assert response.status_code == 200, response.json()
E AssertionError: {'data': {'users': None, 'users_sort_by_dog_award': None}, 'errors': [{'locations': [{'column': 5, 'line': 3}], 'messa...s': [{'column': 5, 'line': 9}], 'message': "<usersSort.dog_award: 'dog_award'>", 'path': ['users_sort_by_dog_award']}]}
E assert 500 == 200
E + where 500 = <Response [500 Internal Server Error]>.status_code
tests/test_graphql.py:143: AssertionError
=========================== short test summary info ============================
FAILED tests/test_graphql.py::test_graphql_examples[path1] - AssertionError: ...
FAILED tests/test_graphql.py::test_graphql_examples[path13] - AssertionError:...
FAILED tests/test_graphql.py::test_graphql_examples[path14] - AssertionError:...
=================== 3 failed, 63 passed, 1 skipped in 4.16s ====================
For this one:
Error is:
E AssertionError: {'data': {'users': None}, 'errors': [{'locations': [{'column': 5, 'line': 3}], 'message': "<usersSortDesc.points: 'points'>", 'path': ['users']}]}
usersSortDesc.points
is an enum, and enums changed according to the release notes here: https://github.com/graphql-python/graphene/wiki/v3-release-notes
These release notes are more detailed but less useful: https://github.com/graphql-python/graphene/releases/tag/v3.0.0
I think I'm hitting this bug:
Refs #80