@@ -190,6 +190,10 @@ def asyncReturnError(self):
190
190
)
191
191
)
192
192
193
+ def sort_key (item ):
194
+ locations = item ['locations' ][0 ]
195
+ return (locations ['line' ], locations ['column' ])
196
+
193
197
def handle_results (result ):
194
198
assert result .data == {
195
199
'async' : 'async' ,
@@ -201,15 +205,15 @@ def handle_results(result):
201
205
'syncReturnError' : None ,
202
206
'syncReturnErrorList' : ['sync0' , None , 'sync2' , None ]
203
207
}
204
- assert list (map (format_error , result .errors )) == [
208
+ assert sorted ( list (map (format_error , result .errors )), key = sort_key ) == sorted ( [
205
209
{'locations' : [{'line' : 4 , 'column' : 9 }], 'message' : 'Error getting syncError' },
206
210
{'locations' : [{'line' : 5 , 'column' : 9 }], 'message' : 'Error getting syncReturnError' },
207
211
{'locations' : [{'line' : 6 , 'column' : 9 }], 'message' : 'Error getting syncReturnErrorList1' },
208
212
{'locations' : [{'line' : 6 , 'column' : 9 }], 'message' : 'Error getting syncReturnErrorList3' },
209
213
{'locations' : [{'line' : 8 , 'column' : 9 }], 'message' : 'Error getting asyncReject' },
210
214
{'locations' : [{'line' : 9 , 'column' : 9 }], 'message' : 'An unknown error occurred.' },
211
215
{'locations' : [{'line' : 10 , 'column' : 9 }], 'message' : 'Error getting asyncReturnError' }
212
- ]
216
+ ], key = sort_key )
213
217
214
218
handle_results (execute (schema , ast , Data (), executor = ThreadExecutor ()))
215
219
0 commit comments