Skip to content

Commit a1dd115

Browse files
committed
Fixed CustomPromise to inherit from Promise
1 parent 4413592 commit a1dd115

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

graphql/execution/tests/test_resolve.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,7 @@
88
GraphQLObjectType, GraphQLSchema, GraphQLString)
99
from promise import Promise
1010

11-
class CustomPromise(object):
12-
def __init__(self, fn=None, promise=None):
13-
self._promise = promise or Promise(fn)
14-
15-
def get(self, _=None):
16-
raise NotImplementedError("Blocking for results not allowed. Use 'then' if you want to "
17-
"work with the result.")
18-
19-
def then(self, success=None, failure=None):
20-
return self.__class__(promise=self._promise.then(success, failure))
21-
22-
def __getattr__(self, item):
23-
return getattr(self._promise, item)
24-
11+
class CustomPromise(Promise):
2512
@classmethod
2613
def fulfilled(cls, x):
2714
p = cls()

0 commit comments

Comments
 (0)