We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e5c58b commit 6664eb7Copy full SHA for 6664eb7
tests/error/test_located_error.py
@@ -1,3 +1,5 @@
1
+from typing import cast, Any
2
+
3
from pytest import raises # type: ignore
4
5
from graphql.error import GraphQLError, located_error
@@ -12,8 +14,7 @@ def throws_without_an_original_error():
12
14
13
15
def passes_graphql_error_through():
16
path = ["path", 3, "to", "field"]
- # noinspection PyArgumentEqualDefault
- e = GraphQLError("msg", None, None, None, path) # type: ignore
17
+ e = GraphQLError("msg", None, None, None, cast(Any, path))
18
assert located_error(e, [], []) == e
19
20
def passes_graphql_error_ish_through():
@@ -23,6 +24,5 @@ def passes_graphql_error_ish_through():
23
24
25
def does_not_pass_through_elasticsearch_like_errors():
26
e = Exception("I am from elasticsearch")
- # noinspection PyTypeHints
27
- e.path = "/something/feed/_search" # type: ignore
+ cast(Any, e).path = "/something/feed/_search"
28
assert located_error(e, [], []) is not e
0 commit comments