From 3c386dee9b0d91258286bc59264aafcab6b59b79 Mon Sep 17 00:00:00 2001 From: Rena Hubbard Date: Fri, 28 Jan 2022 22:20:21 +0100 Subject: [PATCH] Bump graphql-core from 3.1.7 to 3.2.0 in /tests (#332) * Bump graphql-core from 3.1.7 to 3.2.0 in /tests Bumps [graphql-core](https://github.com/graphql-python/graphql-core) from 3.1.7 to 3.2.0. - [Release notes](https://github.com/graphql-python/graphql-core/releases) - [Commits](https://github.com/graphql-python/graphql-core/compare/v3.1.7...v3.2.0) --- updated-dependencies: - dependency-name: graphql-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix trailing new lines in graphql schema See https://github.com/graphql-python/graphql-core/issues/157 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joseph Perez --- README.md | 3 +-- examples/additional_types.py | 3 +-- examples/base_schema_parameter.py | 3 +-- examples/enum_schemas.py | 3 +-- examples/examples/sqlalchemy_support.py | 3 +-- examples/examples/subclass_tagged_union.py | 6 ++---- examples/graphql_overview.py | 6 ++---- examples/graphql_type_name.py | 3 +-- examples/id_type.py | 3 +-- examples/interface.py | 3 +-- examples/operation.py | 3 +-- examples/quickstart.py | 3 +-- examples/relay_client_mutation_id.py | 3 +-- examples/relay_connection.py | 6 ++---- examples/relay_connection_subclass.py | 3 +-- examples/relay_global_id.py | 3 +-- examples/relay_mutation.py | 3 +-- examples/relay_node.py | 3 +-- examples/resolver.py | 3 +-- examples/resolver_error.py | 3 +-- examples/resolver_metadata.py | 3 +-- examples/scalar.py | 3 +-- examples/subscription.py | 3 +-- examples/subscription_resolve.py | 3 +-- examples/tagged_union_graphql_schema.py | 6 ++---- examples/union_type_name.py | 3 +-- tests/integration/test_annotated_schema.py | 3 +-- tests/integration/test_default_conversion_type_name.py | 3 +-- .../test_resolver_default_parameter_not_serializable.py | 3 +-- tests/requirements.txt | 2 +- tests/unit/test_flattened_conversion.py | 6 ++---- tests/unit/test_subscriptions.py | 3 +-- 32 files changed, 37 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index 1b2cf81..803e0d9 100644 --- a/README.md +++ b/README.md @@ -105,8 +105,7 @@ type Resource { id: ID! name: String! tags: [String!]! -} -""" +}""" assert print_schema(schema) == schema_str ``` *apischema* works out of the box with your data model. diff --git a/examples/additional_types.py b/examples/additional_types.py index fb9bb58..3c17fb2 100644 --- a/examples/additional_types.py +++ b/examples/additional_types.py @@ -34,6 +34,5 @@ def bar() -> Bar: type Query { bar: Bar! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/base_schema_parameter.py b/examples/base_schema_parameter.py index 6e5ca9a..5368876 100644 --- a/examples/base_schema_parameter.py +++ b/examples/base_schema_parameter.py @@ -54,6 +54,5 @@ def foo() -> Foo: """arg parameter""" arg: String! ): Int! -} -''' +}''' assert print_schema(schema_) == schema_str diff --git a/examples/enum_schemas.py b/examples/enum_schemas.py index c4db621..357117f 100644 --- a/examples/enum_schemas.py +++ b/examples/enum_schemas.py @@ -28,7 +28,6 @@ def echo(enum: MyEnum) -> MyEnum: """foo""" FOO BAR -} -''' +}''' assert print_schema(schema_) == schema_str assert graphql_sync(schema_, "{echo(enum: FOO)}").data == {"echo": "FOO"} diff --git a/examples/examples/sqlalchemy_support.py b/examples/examples/sqlalchemy_support.py index 74e4d69..21f501f 100644 --- a/examples/examples/sqlalchemy_support.py +++ b/examples/examples/sqlalchemy_support.py @@ -76,6 +76,5 @@ def foos() -> Collection[Foo] | None: type Foo { bar: Int! baz: String -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/examples/subclass_tagged_union.py b/examples/examples/subclass_tagged_union.py index 92a78ea..245ef1b 100644 --- a/examples/examples/subclass_tagged_union.py +++ b/examples/examples/subclass_tagged_union.py @@ -167,8 +167,7 @@ def echo(drawing: Drawing = None) -> Drawing | None: input ConcatInput { left: DrawingInput! right: DrawingInput! -} -""" +}""" ) query = """\ @@ -200,8 +199,7 @@ def echo(drawing: Drawing = None) -> Drawing | None: } } } -} -""" +}""" assert graphql.graphql_sync(drawing_schema, query).data == { "echo": { diff --git a/examples/graphql_overview.py b/examples/graphql_overview.py index feb5c71..238800d 100644 --- a/examples/graphql_overview.py +++ b/examples/graphql_overview.py @@ -71,8 +71,7 @@ def user(username: str) -> User | None: content: String! } -scalar Datetime -""" +scalar Datetime""" assert print_schema(schema) == schema_str query = """ @@ -83,8 +82,7 @@ def user(username: str) -> User | None: content } } -} -""" +}""" assert graphql_sync(schema, query).data == { "users": [ {"username": "foo", "posts": [{"content": "Hello world!"}]}, diff --git a/examples/graphql_type_name.py b/examples/graphql_type_name.py index b8711a5..8ef83ba 100644 --- a/examples/graphql_type_name.py +++ b/examples/graphql_type_name.py @@ -24,6 +24,5 @@ def foo() -> FooFoo | None: type Foo { bar: Int! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/id_type.py b/examples/id_type.py index d3ba583..3d0a9c8 100644 --- a/examples/id_type.py +++ b/examples/id_type.py @@ -24,6 +24,5 @@ def foo() -> Foo | None: type Foo { bar: ID! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/interface.py b/examples/interface.py index b4cb4d1..8a54e29 100644 --- a/examples/interface.py +++ b/examples/interface.py @@ -33,6 +33,5 @@ def foo() -> Foo | None: interface Bar { bar: Int! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/operation.py b/examples/operation.py index 858c46d..358515b 100644 --- a/examples/operation.py +++ b/examples/operation.py @@ -24,6 +24,5 @@ async def get_foo() -> Foo: type Foo { bar(arg: Int! = 0): String! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/quickstart.py b/examples/quickstart.py index 4911776..b23c902 100644 --- a/examples/quickstart.py +++ b/examples/quickstart.py @@ -67,6 +67,5 @@ def resources(tags: Collection[str] | None = None) -> Collection[Resource] | Non id: ID! name: String! tags: [String!]! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/relay_client_mutation_id.py b/examples/relay_client_mutation_id.py index af6b402..fa58540 100644 --- a/examples/relay_client_mutation_id.py +++ b/examples/relay_client_mutation_id.py @@ -59,6 +59,5 @@ def hello() -> str: factionId: String! shipName: String! clientMutationId: String! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/relay_connection.py b/examples/relay_connection.py index 66686f2..2531897 100644 --- a/examples/relay_connection.py +++ b/examples/relay_connection.py @@ -60,8 +60,7 @@ def faction() -> Faction | None: hasNextPage: Boolean! startCursor: Int endCursor: Int -} -""" +}""" assert print_schema(schema) == schema_str query = """ { @@ -79,8 +78,7 @@ def faction() -> Faction | None: } } } -} -""" +}""" assert graphql.graphql_sync(schema, query).data == { "faction": { "ships": { diff --git a/examples/relay_connection_subclass.py b/examples/relay_connection_subclass.py index 16acf4b..6fad97a 100644 --- a/examples/relay_connection_subclass.py +++ b/examples/relay_connection_subclass.py @@ -72,6 +72,5 @@ def faction() -> Faction | None: hasNextPage: Boolean! startCursor: Int endCursor: Int -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/relay_global_id.py b/examples/relay_global_id.py index 2dc1a9c..8457029 100644 --- a/examples/relay_global_id.py +++ b/examples/relay_global_id.py @@ -25,8 +25,7 @@ def get_by_id(cls, id: int, info: graphql.GraphQLResolveInfo = None) -> "Faction name } } -} -""" +}""" assert graphql.graphql_sync( # ... and use it in a query schema, query, variable_values={"id": serialize(relay.GlobalId, some_global_id)} ).data == {"node": {"name": "Empire"}} diff --git a/examples/relay_mutation.py b/examples/relay_mutation.py index d8ae908..4d3fbba 100644 --- a/examples/relay_mutation.py +++ b/examples/relay_mutation.py @@ -53,6 +53,5 @@ def hello() -> str: factionId: String! shipName: String! clientMutationId: String -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/relay_node.py b/examples/relay_node.py index 0bd742a..3bbbf18 100644 --- a/examples/relay_node.py +++ b/examples/relay_node.py @@ -43,6 +43,5 @@ def get_by_id(cls, id: int, info: graphql.GraphQLResolveInfo = None) -> "Faction type Query { node(id: ID!): Node! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/resolver.py b/examples/resolver.py index c02b7df..db1afc7 100644 --- a/examples/resolver.py +++ b/examples/resolver.py @@ -33,6 +33,5 @@ async def foo() -> Foo | None: type Bar { baz: Int! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/resolver_error.py b/examples/resolver_error.py index f50d573..a64a03a 100644 --- a/examples/resolver_error.py +++ b/examples/resolver_error.py @@ -44,8 +44,7 @@ def foo(info: graphql.GraphQLResolveInfo) -> Foo: type Foo { bar: Int baz: Int! -} -""" +}""" assert print_schema(schema) == schema_str # Logs "Resolve error in foo.bar", no error raised assert graphql.graphql_sync(schema, "{foo{bar}}").data == {"foo": {"bar": None}} diff --git a/examples/resolver_metadata.py b/examples/resolver_metadata.py index 48d36dd..2bde6c0 100644 --- a/examples/resolver_metadata.py +++ b/examples/resolver_metadata.py @@ -32,6 +32,5 @@ def foo() -> Foo: """argument""" arg: Int! ): Int! -} -''' +}''' assert print_schema(schema_) == schema_str diff --git a/examples/scalar.py b/examples/scalar.py index f236dbd..415a2ed 100644 --- a/examples/scalar.py +++ b/examples/scalar.py @@ -30,6 +30,5 @@ def foo() -> Foo | None: scalar UUID -scalar JSON -""" +scalar JSON""" assert print_schema(schema) == schema_str diff --git a/examples/subscription.py b/examples/subscription.py index 374512d..d862e75 100644 --- a/examples/subscription.py +++ b/examples/subscription.py @@ -24,8 +24,7 @@ async def events() -> AsyncIterable[str]: type Subscription { events: String! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/subscription_resolve.py b/examples/subscription_resolve.py index 38c8735..04161d1 100644 --- a/examples/subscription_resolve.py +++ b/examples/subscription_resolve.py @@ -38,8 +38,7 @@ class Message: type Message { body: String! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/examples/tagged_union_graphql_schema.py b/examples/tagged_union_graphql_schema.py index 1092b9a..fd0b7c9 100644 --- a/examples/tagged_union_graphql_schema.py +++ b/examples/tagged_union_graphql_schema.py @@ -43,8 +43,7 @@ def query(foo: Foo) -> Foo: input BarInput { field: String! -} -""" +}""" assert print_schema(schema) == schema_str query_str = """ @@ -55,8 +54,7 @@ def query(foo: Foo) -> Foo: } baz } -} -""" +}""" assert graphql_sync(schema, query_str).data == { "query": {"bar": {"field": "value"}, "baz": None} } diff --git a/examples/union_type_name.py b/examples/union_type_name.py index 6ec365f..2f50c29 100644 --- a/examples/union_type_name.py +++ b/examples/union_type_name.py @@ -34,6 +34,5 @@ def foo_or_bar() -> Foo | Bar: type Bar { bar: Int! -} -""" +}""" assert print_schema(schema) == schema_str diff --git a/tests/integration/test_annotated_schema.py b/tests/integration/test_annotated_schema.py index 89f785b..635654a 100644 --- a/tests/integration/test_annotated_schema.py +++ b/tests/integration/test_annotated_schema.py @@ -82,6 +82,5 @@ def test_annotated_schema(): } """type description""" -scalar someInt -''' +scalar someInt''' ) diff --git a/tests/integration/test_default_conversion_type_name.py b/tests/integration/test_default_conversion_type_name.py index 73a436b..15db1ed 100644 --- a/tests/integration/test_default_conversion_type_name.py +++ b/tests/integration/test_default_conversion_type_name.py @@ -35,8 +35,7 @@ def test_default_conversion_type_name(): type B { a: Int! -} -""" +}""" ) assert serialization_schema(B, all_refs=True) == { "$ref": "#/$defs/B", diff --git a/tests/integration/test_resolver_default_parameter_not_serializable.py b/tests/integration/test_resolver_default_parameter_not_serializable.py index 8d6400e..071afb1 100644 --- a/tests/integration/test_resolver_default_parameter_not_serializable.py +++ b/tests/integration/test_resolver_default_parameter_not_serializable.py @@ -32,8 +32,7 @@ def resolver(arg=default) -> bool: == """\ type Query { resolver(arg: Int): Boolean! -} -""" +}""" ) assert ( graphql_sync(schema, "{resolver}").data diff --git a/tests/requirements.txt b/tests/requirements.txt index 28cffe4..2c59978 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,5 @@ dataclasses==0.8;python_version<'3.7' -graphql-core==3.1.7 +graphql-core==3.2.0 attrs==21.4.0 bson==0.5.10 docstring-parser==0.13 diff --git a/tests/unit/test_flattened_conversion.py b/tests/unit/test_flattened_conversion.py index 87ec362..237d452 100644 --- a/tests/unit/test_flattened_conversion.py +++ b/tests/unit/test_flattened_conversion.py @@ -59,8 +59,7 @@ def test_flattened_dataclass_model(): type Data { attr: Int! -} -""" +}""" ) @@ -126,8 +125,7 @@ def test_flattened_converted(): type Data2 { attr: Int! -} -""" +}""" ) diff --git a/tests/unit/test_subscriptions.py b/tests/unit/test_subscriptions.py index f1e81f6..e451fb1 100644 --- a/tests/unit/test_subscriptions.py +++ b/tests/unit/test_subscriptions.py @@ -84,8 +84,7 @@ async def test_subscription(alias, conversion, error_handler, resolver): type Subscription { %s -} -""" +}""" assert print_schema(schema) == schema_str % sub_field sub_query = sub_name if conversion is None: