Skip to content

Commit 391deaa

Browse files
author
haoxiangpeng
committed
Update test to new Graphene API
1 parent ab5831f commit 391deaa

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ matrix:
66
env: TOX_ENV=pypy
77
- python: '2.7'
88
env: TOX_ENV=py27
9-
- python: '3.3'
10-
env: TOX_ENV=py33
119
- python: '3.4'
1210
env: TOX_ENV=py34
1311
- python: '3.5'
14-
env: TOX_ENV=py35,import-order,flake8
12+
env: TOX_ENV=py35
13+
- python: '3.6'
14+
env: TOX_ENV=py36,import-order,flake8
1515
cache:
1616
directories:
1717
- $HOME/.cache/pip

tests/schema.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ def resolve_raises(*_):
1212
fields={
1313
'thrower': GraphQLField(GraphQLNonNull(GraphQLString), resolver=resolve_raises),
1414
'request': GraphQLField(GraphQLNonNull(GraphQLString),
15-
resolver=lambda obj, args, context, info: context.args.get('q')),
15+
resolver=lambda obj, info: info.context.args.get('q')),
1616
'context': GraphQLField(GraphQLNonNull(GraphQLString),
17-
resolver=lambda obj, args, context, info: context),
17+
resolver=lambda obj, info: info.context),
1818
'test': GraphQLField(
1919
type=GraphQLString,
2020
args={
2121
'who': GraphQLArgument(GraphQLString)
2222
},
23-
resolver=lambda obj, args, context, info: 'Hello %s' % (args.get('who') or 'World')
23+
resolver=lambda obj, info, who=None: 'Hello %s' % (who or 'World')
2424
)
2525
}
2626
)

tox.ini

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = flake8,import-order,py35,py27,py33,py34,pypy
2+
envlist = flake8,import-order,py36,py27,py34,py35,pypy
33
skipsdist = true
44

55
[testenv]
@@ -13,16 +13,16 @@ deps =
1313
Flask>=0.10.0
1414
pytest-cov
1515
commands =
16-
py{py,27,33,34,35}: py.test tests {posargs}
16+
py{py,27,34,35,36}: py.test tests {posargs}
1717

1818
[testenv:flake8]
19-
basepython=python3.5
19+
basepython=python3.6
2020
deps = flake8
2121
commands =
2222
flake8 flask_graphql
2323

2424
[testenv:import-order]
25-
basepython=python3.5
25+
basepython=python3.6
2626
deps =
2727
isort
2828
graphql-core>=1.0

0 commit comments

Comments
 (0)