Skip to content

Commit 74b16c6

Browse files
committed
tests: replace exceptions with assertions whenever possible
Replicates graphql/graphql-js@2616dc7
1 parent 3d13d7a commit 74b16c6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tests/execution/test_union_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def resolve_pet_type(value, _info, _type):
113113
return CatType.name
114114

115115
# Not reachable. All possible types have been considered.
116-
raise TypeError("Unexpected pet type")
116+
assert False, "Unexpected pet type"
117117

118118

119119
PetType = GraphQLUnionType("Pet", [DogType, CatType], resolve_type=resolve_pet_type)

tests/execution/test_variables.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def parse_serialized_value(value: str) -> str:
2929

3030
def parse_literal_value(ast: ValueNode, _variables=None) -> str:
3131
assert isinstance(ast, StringValueNode)
32+
assert ast.value == "SerializedValue"
3233
return parse_serialized_value(ast.value)
3334

3435

0 commit comments

Comments
 (0)