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):
264
264
),
265
265
)
266
266
267
+ """
268
+ From graphql-core version 3.1.5, print_ast() break arguments over multiple lines
269
+ Accepting both cases here
270
+ """
271
+
267
272
assert (
268
- print_ast (query )
269
- == """query GetHeroName {
273
+ (
274
+ print_ast (query )
275
+ == """query GetHeroName {
270
276
hero {
271
277
name
272
278
}
@@ -280,6 +286,26 @@ def test_multiple_operations(ds):
280
286
}
281
287
}
282
288
"""
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
+ )
283
309
)
284
310
285
311
Original file line number Diff line number Diff line change @@ -75,9 +75,23 @@ def validation_errors(client, query):
75
75
76
76
77
77
def test_incompatible_request_gql (client ):
78
- with pytest .raises (TypeError ) as exc_info :
78
+ with pytest .raises (TypeError ):
79
79
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
+ """
81
95
82
96
83
97
def test_nested_query_with_fragment (client ):
You can’t perform that action at this time.
0 commit comments