File tree Expand file tree Collapse file tree 2 files changed +44
-4
lines changed Expand file tree Collapse file tree 2 files changed +44
-4
lines changed Original file line number Diff line number Diff line change @@ -264,9 +264,15 @@ def test_multiple_operations(ds):
264264 ),
265265 )
266266
267+ """
268+ From graphql-core version 3.1.5, print_ast() break arguments over multiple lines
269+ Accepting both cases here
270+ """
271+
267272 assert (
268- print_ast (query )
269- == """query GetHeroName {
273+ (
274+ print_ast (query )
275+ == """query GetHeroName {
270276 hero {
271277 name
272278 }
@@ -280,6 +286,26 @@ def test_multiple_operations(ds):
280286 }
281287}
282288"""
289+ )
290+ or (
291+ print_ast (query )
292+ == """query GetHeroName {
293+ hero {
294+ name
295+ }
296+ }
297+
298+ mutation CreateReviewMutation {
299+ createReview(
300+ episode: JEDI
301+ review: {stars: 5, commentary: "This is a great movie!"}
302+ ) {
303+ stars
304+ commentary
305+ }
306+ }
307+ """
308+ )
283309 )
284310
285311
Original file line number Diff line number Diff line change @@ -75,9 +75,23 @@ def validation_errors(client, query):
7575
7676
7777def test_incompatible_request_gql (client ):
78- with pytest .raises (TypeError ) as exc_info :
78+ with pytest .raises (TypeError ):
7979 gql (123 )
80- assert "body must be a string" in str (exc_info .value )
80+
81+ """
82+ The error generated depends on graphql-core version
83+ < 3.1.5: "body must be a string"
84+ >= 3.1.5: some variation of "object of type 'int' has no len()"
85+ depending on the python environment
86+
87+ So we are not going to check the exact error message here anymore.
88+ """
89+
90+ """
91+ assert ("body must be a string" in str(exc_info.value)) or (
92+ "object of type 'int' has no len()" in str(exc_info.value)
93+ )
94+ """
8195
8296
8397def test_nested_query_with_fragment (client ):
You can’t perform that action at this time.
0 commit comments