Skip to content

Commit 51192d5

Browse files
committed
Fixed tests
1 parent cd1c50f commit 51192d5

File tree

4 files changed

+20
-30
lines changed

4 files changed

+20
-30
lines changed

graphql/error/tests/test_base.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
from graphql.execution import execute
55
from graphql.language.parser import parse
66
from graphql.type import GraphQLField, GraphQLObjectType, GraphQLSchema, GraphQLString
7-
from graphql.execution.base import ResolveInfo
8-
from mypy_extensions import NoReturn
9-
from typing import Any
10-
from typing import Optional
7+
8+
if False:
9+
from graphql.execution.base import ResolveInfo
10+
from typing import Any
11+
from typing import Optional
1112

1213

1314
def test_raise():
1415
# type: () -> None
1516
ast = parse("query Example { a }")
1617

1718
def resolver(context, *_):
18-
# type: (Optional[Any], *ResolveInfo) -> NoReturn
19+
# type: (Optional[Any], *ResolveInfo) -> None
1920
raise Exception("Failed")
2021

2122
Type = GraphQLObjectType(
@@ -31,7 +32,7 @@ def test_reraise():
3132
ast = parse("query Example { a }")
3233

3334
def resolver(context, *_):
34-
# type: (Optional[Any], *ResolveInfo) -> NoReturn
35+
# type: (Optional[Any], *ResolveInfo) -> None
3536
raise Exception("Failed")
3637

3738
Type = GraphQLObjectType(

graphql/execution/tests/test_mutations.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
GraphQLSchema,
1111
GraphQLString,
1212
)
13-
from mypy_extensions import NoReturn
1413

1514
# from graphql.execution.executors.asyncio import AsyncioExecutor
1615
# from graphql.execution.executors.thread import ThreadExecutor
@@ -39,11 +38,11 @@ def promise_to_change_the_number(self, n):
3938
return self.immediately_change_the_number(n)
4039

4140
def fail_to_change_the_number(self, n):
42-
# type: (int) -> NoReturn
41+
# type: (int) -> None
4342
raise Exception("Cannot change the number")
4443

4544
def promise_and_fail_to_change_the_number(self, n):
46-
# type: (int) -> NoReturn
45+
# type: (int) -> None
4746
# TODO: async
4847
self.fail_to_change_the_number(n)
4948

graphql/execution/tests/test_nonnull.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212

1313
from .utils import rejected, resolved
1414

15-
# from mypy_extensions import NoReturn
16-
# from promise.promise import Promise
17-
# from typing import Any
18-
# from typing import Optional
19-
# from typing import Dict
20-
# from typing import Tuple
21-
# from typing import Union
15+
if False:
16+
from promise import Promise
17+
from typing import Any, Optional, Dict, Tuple, Union
2218

2319
sync_error = Exception("sync")
2420
non_null_sync_error = Exception("nonNullSync")
@@ -28,11 +24,11 @@
2824

2925
class ThrowingData(object):
3026
def sync(self):
31-
# type: () -> NoReturn
27+
# type: () -> None
3228
raise sync_error
3329

3430
def nonNullSync(self):
35-
# type: () -> NoReturn
31+
# type: () -> None
3632
raise non_null_sync_error
3733

3834
def promise(self):

graphql/execution/tests/test_subscribe.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,11 @@
1515
subscribe,
1616
)
1717

18-
# from graphql.execution.base import ResolveInfo
19-
# from rx.core.anonymousobservable import AnonymousObservable
20-
# from rx.subjects.subject import Subject
21-
# from typing import Optional
22-
# from typing import Union
23-
# from mypy_extensions import NoReturn
24-
# from typing import Any
25-
# from typing import Callable
26-
# from graphql.type.schema import GraphQLSchema
27-
# from graphql.execution.base import ExecutionResult
28-
# from typing import Tuple
18+
if False:
19+
from graphql.execution.base import ResolveInfo
20+
from rx.core.anonymousobservable import AnonymousObservable
21+
from typing import Optional, Union, Any, Callable, Tuple
22+
from graphql.execution.base import ExecutionResult
2923

3024
Email = namedtuple("Email", "from_,subject,message,unread")
3125

@@ -277,7 +271,7 @@ def test_returns_an_error_if_subscribe_function_returns_error():
277271
exc = Exception("Throw!")
278272

279273
def thrower(root, info):
280-
# type: (Optional[Any], ResolveInfo) -> NoReturn
274+
# type: (Optional[Any], ResolveInfo) -> None
281275
raise exc
282276

283277
erroring_email_schema = email_schema_with_resolvers(thrower)

0 commit comments

Comments
 (0)