Skip to content

Commit 6664eb7

Browse files
committed
Cast to Any instead of ignoring type error
Somewhat replicates graphql/graphql-js@95aa338
1 parent 4e5c58b commit 6664eb7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/error/test_located_error.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import cast, Any
2+
13
from pytest import raises # type: ignore
24

35
from graphql.error import GraphQLError, located_error
@@ -12,8 +14,7 @@ def throws_without_an_original_error():
1214

1315
def passes_graphql_error_through():
1416
path = ["path", 3, "to", "field"]
15-
# noinspection PyArgumentEqualDefault
16-
e = GraphQLError("msg", None, None, None, path) # type: ignore
17+
e = GraphQLError("msg", None, None, None, cast(Any, path))
1718
assert located_error(e, [], []) == e
1819

1920
def passes_graphql_error_ish_through():
@@ -23,6 +24,5 @@ def passes_graphql_error_ish_through():
2324

2425
def does_not_pass_through_elasticsearch_like_errors():
2526
e = Exception("I am from elasticsearch")
26-
# noinspection PyTypeHints
27-
e.path = "/something/feed/_search" # type: ignore
27+
cast(Any, e).path = "/something/feed/_search"
2828
assert located_error(e, [], []) is not e

0 commit comments

Comments
 (0)