Skip to content

Commit 9f64828

Browse files
author
Daniel Gallagher
committed
Make py2 compatible by importing print_function from __future__
1 parent debd053 commit 9f64828

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

graphql/execution/tests/test_middleware.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
from graphql.execution.middleware import middleware_chain
2-
from graphql.execution.middleware import get_middleware_resolvers
3-
from graphql.language.parser import parse
1+
from __future__ import print_function
2+
43
from graphql.execution import MiddlewareManager, execute
4+
from graphql.execution.middleware import (get_middleware_resolvers,
5+
middleware_chain)
6+
from graphql.language.parser import parse
57
from graphql.type import (GraphQLArgument, GraphQLBoolean, GraphQLField,
6-
GraphQLInt, GraphQLList, GraphQLObjectType,
7-
GraphQLSchema, GraphQLString, GraphQLNonNull, GraphQLID)
8+
GraphQLID, GraphQLInt, GraphQLList, GraphQLNonNull,
9+
GraphQLObjectType, GraphQLSchema, GraphQLString)
810
from promise import Promise
911

1012

@@ -120,9 +122,9 @@ def __init__(self, char):
120122
self.char = char
121123

122124
def resolve(self, next, *args, **kwargs):
123-
print(f'resolve() called for middleware {self.char}')
125+
print("resolve() called for middleware {}".format(self.char))
124126
return next(*args, **kwargs).then(
125-
lambda x: print(f'then() for {self.char}')
127+
lambda x: print("then() for {}".format(self.char))
126128
)
127129

128130
middlewares = [
@@ -154,4 +156,4 @@ def func(): return
154156

155157
def assert_stdout(capsys, expected_stdout):
156158
captured = capsys.readouterr()
157-
assert captured.out == expected_stdout
159+
assert captured.out == expected_stdout

0 commit comments

Comments
 (0)