Skip to content

Commit 786e600

Browse files
committed
Properly order tests for GraphQLError serialization
1 parent e51fada commit 786e600

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/error/test_graphql_error.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,16 @@ def serializes_to_include_message_and_locations():
184184
"message": "msg",
185185
}
186186

187+
def serializes_to_include_path():
188+
path: List[Union[int, str]] = ["path", 3, "to", "field"]
189+
e = GraphQLError("msg", path=path)
190+
assert e.path is path
191+
assert repr(e) == "GraphQLError('msg', path=['path', 3, 'to', 'field'])"
192+
assert e.formatted == {
193+
"message": "msg",
194+
"path": ["path", 3, "to", "field"],
195+
}
196+
187197
def serializes_to_include_all_standard_fields():
188198
e_short = GraphQLError("msg")
189199
assert str(e_short) == "msg"
@@ -210,16 +220,6 @@ def repr_includes_extensions():
210220
e = GraphQLError("msg", extensions={"foo": "bar"})
211221
assert repr(e) == "GraphQLError('msg', extensions={'foo': 'bar'})"
212222

213-
def serializes_to_include_path():
214-
path: List[Union[int, str]] = ["path", 3, "to", "field"]
215-
e = GraphQLError("msg", path=path)
216-
assert e.path is path
217-
assert repr(e) == "GraphQLError('msg', path=['path', 3, 'to', 'field'])"
218-
assert e.formatted == {
219-
"message": "msg",
220-
"path": ["path", 3, "to", "field"],
221-
}
222-
223223
def always_stores_path_as_list():
224224
path: List[Union[int, str]] = ["path", 3, "to", "field"]
225225
e = GraphQLError("msg,", path=tuple(path))

0 commit comments

Comments
 (0)