Skip to content

Commit fad9b97

Browse files
committed
Fix some flake8 issues
1 parent 10775c9 commit fad9b97

File tree

6 files changed

+122
-118
lines changed

6 files changed

+122
-118
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
ignore = E203,W503,E704
3+
exclude = .git,.mypy_cache,.pytest_cache,.tox,.venv,__pycache__,build,dist,docs
4+
max-line-length = 88

graphql_relay/mutation/tests/test_mutation.py

Lines changed: 80 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -332,92 +332,91 @@ async def test_contains_correct_field():
332332
'''
333333
expected = {
334334
'__schema': {
335-
'mutationType': {
336-
'fields': [
337-
{
338-
'name': 'simpleMutation',
339-
'args': [
340-
{
341-
'name': 'input',
342-
'type': {
343-
'name': None,
344-
'kind': 'NON_NULL',
345-
'ofType': {
346-
'name': 'SimpleMutationInput',
347-
'kind': 'INPUT_OBJECT'
348-
}
349-
},
335+
'mutationType': {
336+
'fields': [
337+
{
338+
'name': 'simpleMutation',
339+
'args': [
340+
{
341+
'name': 'input',
342+
'type': {
343+
'name': None,
344+
'kind': 'NON_NULL',
345+
'ofType': {
346+
'name': 'SimpleMutationInput',
347+
'kind': 'INPUT_OBJECT'
348+
}
349+
},
350+
}
351+
],
352+
'type': {
353+
'name': 'SimpleMutationPayload',
354+
'kind': 'OBJECT',
350355
}
351-
],
352-
'type': {
353-
'name': 'SimpleMutationPayload',
354-
'kind': 'OBJECT',
355-
}
356-
},
357-
{
358-
'name': 'simpleMutationWithThunkFields',
359-
'args': [
360-
{
361-
'name': 'input',
362-
'type': {
363-
'name': None,
364-
'kind': 'NON_NULL',
365-
'ofType': {
366-
'name':
356+
},
357+
{
358+
'name': 'simpleMutationWithThunkFields',
359+
'args': [
360+
{
361+
'name': 'input',
362+
'type': {
363+
'name': None,
364+
'kind': 'NON_NULL',
365+
'ofType': {
366+
'name':
367367
'SimpleMutationWithThunkFieldsInput',
368-
'kind': 'INPUT_OBJECT'
369-
}
370-
},
368+
'kind': 'INPUT_OBJECT'
369+
}
370+
},
371+
}
372+
],
373+
'type': {
374+
'name': 'SimpleMutationWithThunkFieldsPayload',
375+
'kind': 'OBJECT',
371376
}
372-
],
373-
'type': {
374-
'name': 'SimpleMutationWithThunkFieldsPayload',
375-
'kind': 'OBJECT',
376-
}
377-
},
378-
{
379-
'name': 'simpleAsyncMutation',
380-
'args': [
381-
{
382-
'name': 'input',
377+
},
378+
{
379+
'name': 'simpleAsyncMutation',
380+
'args': [
381+
{
382+
'name': 'input',
383+
'type': {
384+
'name': None,
385+
'kind': 'NON_NULL',
386+
'ofType': {
387+
'name': 'SimpleAsyncMutationInput',
388+
'kind': 'INPUT_OBJECT'
389+
}
390+
},
391+
}
392+
],
383393
'type': {
384-
'name': None,
385-
'kind': 'NON_NULL',
386-
'ofType': {
387-
'name': 'SimpleAsyncMutationInput',
388-
'kind': 'INPUT_OBJECT'
389-
}
390-
},
391-
}
392-
],
393-
'type': {
394-
'name': 'SimpleAsyncMutationPayload',
395-
'kind': 'OBJECT',
396-
}
397-
},
398-
{
399-
'name': 'simpleRootValueMutation',
400-
'args': [
401-
{
402-
'name': 'input',
394+
'name': 'SimpleAsyncMutationPayload',
395+
'kind': 'OBJECT',
396+
}
397+
},
398+
{
399+
'name': 'simpleRootValueMutation',
400+
'args': [
401+
{
402+
'name': 'input',
403+
'type': {
404+
'name': None,
405+
'kind': 'NON_NULL',
406+
'ofType': {
407+
'name': 'SimpleRootValueMutationInput',
408+
'kind': 'INPUT_OBJECT'
409+
}
410+
},
411+
}
412+
],
403413
'type': {
404-
'name': None,
405-
'kind': 'NON_NULL',
406-
'ofType': {
407-
'name': 'SimpleRootValueMutationInput',
408-
'kind': 'INPUT_OBJECT'
409-
}
410-
},
411-
}
412-
],
413-
'type': {
414-
'name': 'SimpleRootValueMutationPayload',
415-
'kind': 'OBJECT',
416-
}
417-
},
418-
419-
]
420-
}
414+
'name': 'SimpleRootValueMutationPayload',
415+
'kind': 'OBJECT',
416+
}
417+
},
418+
]
419+
}
421420
}
422421
}
423422
result = await graphql(schema, query)

graphql_relay/node/tests/test_global.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def get_node_type(obj, context, info):
6969
'node': node_field,
7070
'allObjects': GraphQLField(
7171
GraphQLList(node_interface),
72-
resolve=lambda _root, _info: [userData['1'], userData['2'], photoData['1'], photoData['2']]
72+
resolve=lambda _root, _info:
73+
[userData['1'], userData['2'], photoData['1'], photoData['2']]
7374
)
7475
}
7576
)

graphql_relay/node/tests/test_node.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,20 @@ async def test_have_correct_node_interface():
261261
'''
262262
expected = {
263263
'__type': {
264-
'name': 'Node',
265-
'kind': 'INTERFACE',
266-
'fields': [
267-
{
268-
'name': 'id',
269-
'type': {
270-
'kind': 'NON_NULL',
271-
'ofType': {
272-
'name': 'ID',
273-
'kind': 'SCALAR'
264+
'name': 'Node',
265+
'kind': 'INTERFACE',
266+
'fields': [
267+
{
268+
'name': 'id',
269+
'type': {
270+
'kind': 'NON_NULL',
271+
'ofType': {
272+
'name': 'ID',
273+
'kind': 'SCALAR'
274+
}
275+
}
274276
}
275-
}
276-
}
277-
]
277+
]
278278
}
279279
}
280280
result = await graphql(schema, query)
@@ -311,29 +311,29 @@ async def test_has_correct_node_root_field():
311311
'''
312312
expected = {
313313
'__schema': {
314-
'queryType': {
315-
'fields': [
316-
{
317-
'name': 'node',
318-
'type': {
319-
'name': 'Node',
320-
'kind': 'INTERFACE'
321-
},
322-
'args': [
323-
{
324-
'name': 'id',
325-
'type': {
326-
'kind': 'NON_NULL',
327-
'ofType': {
328-
'name': 'ID',
329-
'kind': 'SCALAR'
330-
}
314+
'queryType': {
315+
'fields': [
316+
{
317+
'name': 'node',
318+
'type': {
319+
'name': 'Node',
320+
'kind': 'INTERFACE'
321+
},
322+
'args': [
323+
{
324+
'name': 'id',
325+
'type': {
326+
'kind': 'NON_NULL',
327+
'ofType': {
328+
'name': 'ID',
329+
'kind': 'SCALAR'
330+
}
331+
}
332+
}
333+
]
331334
}
332-
}
333335
]
334-
}
335-
]
336-
}
336+
}
337337
}
338338
}
339339
result = await graphql(schema, query)

graphql_relay/node/tests/test_plural.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def resolve_single_input(info, username):
2929

3030
queryType = GraphQLObjectType(
3131
'Query', lambda: {
32-
'usernames': plural_identifying_root_field(
32+
'usernames': plural_identifying_root_field(
3333
'usernames',
3434
description='Map from a username to the user',
3535
input_type=GraphQLString,

tests/starwars/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
# noinspection PyPep8Naming
8585
def createShip(shipName, factionId):
86-
nextShip = len(data['Ship'].keys())+1
86+
nextShip = len(data['Ship']) + 1
8787
newShip = Ship(id=str(nextShip), name=shipName)
8888
data['Ship'][newShip.id] = newShip
8989
data['Faction'][factionId].ships.append(newShip.id)

0 commit comments

Comments
 (0)