Skip to content

Commit 15bf694

Browse files
committed
Don't validate schema when setting up benchmark tests
GraphQL.js does that too, and it shaves ~0.9s off the execution time: 1.13s -> 0.69s for test_introspection_from_schema.py 0.67s -> 0.21s for test_validate_gql.py
1 parent 4eac695 commit 15bf694

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/benchmarks/test_introspection_from_schema.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
def test_executing_introspection_query(benchmark, big_schema_sdl): # noqa: F811
9-
schema = build_schema(big_schema_sdl)
9+
schema = build_schema(big_schema_sdl, assume_valid=True)
1010
query = parse(introspection_query.get_introspection_query())
1111
result = benchmark(lambda: execute(schema, query))
1212
assert result.errors is None

tests/benchmarks/test_validate_gql.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
def test_validating_introspection_query(benchmark, big_schema_sdl): # noqa: F811
9-
schema = build_schema(big_schema_sdl)
9+
schema = build_schema(big_schema_sdl, assume_valid=True)
1010
query = parse(introspection_query.get_introspection_query())
1111
result = benchmark(lambda: validate(schema, query))
1212
assert result == []

0 commit comments

Comments
 (0)