Skip to content

Commit

Permalink
Don't validate schema when setting up benchmark tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ktosiek committed Sep 8, 2019
1 parent ea71ad5 commit 4f2d73d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/benchmarks/test_introspection_from_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def test_execute_introspection_query(benchmark, big_schema_sdl): # noqa: F811
schema = build_schema(big_schema_sdl)
schema = build_schema(big_schema_sdl, assume_valid=True)
query = parse(introspection_query.get_introspection_query())
result = benchmark(lambda: execute(schema, query))
assert result.errors is None
2 changes: 1 addition & 1 deletion tests/benchmarks/test_validate_gql.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def test_validate_introspection_query(benchmark, big_schema_sdl): # noqa: F811
schema = build_schema(big_schema_sdl)
schema = build_schema(big_schema_sdl, assume_valid=True)
query = parse(introspection_query.get_introspection_query())
result = benchmark(lambda: validate(schema, query))
assert result == []

0 comments on commit 4f2d73d

Please sign in to comment.