tests/benchmarks/test_introspection_from_schema.py
raw| 1 | from graphql import build_schema, parse, execute_sync |
| 2 | from graphql.utilities import get_introspection_query |
| 3 | |
| 4 | from ..fixtures import big_schema_sdl # noqa: F401 |
| 5 | |
| 6 | |
| 7 | def test_execute_introspection_query(benchmark, big_schema_sdl): # noqa: F811 |
| 8 | schema = build_schema(big_schema_sdl, assume_valid=True) |
| 9 | document = parse(get_introspection_query()) |
| 10 | result = benchmark(lambda: execute_sync(schema=schema, document=document)) |
| 11 | assert result.errors is None |