From 6e38e48fafef9673cc97c95e4812fdfac0cc5e28 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Wed, 15 Jun 2016 21:40:54 -0700 Subject: [PATCH] Improved code lint --- graphene/relay/node.py | 4 ++-- graphene/relay/tests/test_node.py | 2 +- graphene/types/objecttype.py | 1 - graphene/types/structures.py | 1 + graphene/types/tests/test_scalars.py | 6 +++++- graphene/utils/copy_fields.py | 1 + 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/graphene/relay/node.py b/graphene/relay/node.py index 52869fea..bca8aeae 100644 --- a/graphene/relay/node.py +++ b/graphene/relay/node.py @@ -4,11 +4,11 @@ import six from graphql_relay import from_global_id, node_definitions, to_global_id -from .connection import Connection from ..types.field import Field from ..types.interface import Interface -from ..types.objecttype import ObjectTypeMeta, ObjectType +from ..types.objecttype import ObjectType, ObjectTypeMeta from ..types.options import Options +from .connection import Connection class NodeMeta(ObjectTypeMeta): diff --git a/graphene/relay/tests/test_node.py b/graphene/relay/tests/test_node.py index 54266af6..04474024 100644 --- a/graphene/relay/tests/test_node.py +++ b/graphene/relay/tests/test_node.py @@ -4,8 +4,8 @@ from graphql_relay import to_global_id from ...types import ObjectType, Schema from ...types.scalars import String -from ..node import Node from ..connection import Connection +from ..node import Node class MyNode(Node, ObjectType): diff --git a/graphene/types/objecttype.py b/graphene/types/objecttype.py index fcfd85cc..e4518145 100644 --- a/graphene/types/objecttype.py +++ b/graphene/types/objecttype.py @@ -1,4 +1,3 @@ -import copy import six diff --git a/graphene/types/structures.py b/graphene/types/structures.py index e1399cfc..d577098f 100644 --- a/graphene/types/structures.py +++ b/graphene/types/structures.py @@ -10,6 +10,7 @@ class Structure(UnmountedType): A structure is a GraphQL type instance that wraps a main type with certain structure. ''' + def __init__(self, of_type, *args, **kwargs): super(Structure, self).__init__(*args, **kwargs) self.of_type = of_type diff --git a/graphene/types/tests/test_scalars.py b/graphene/types/tests/test_scalars.py index 20b1b0eb..4caa8363 100644 --- a/graphene/types/tests/test_scalars.py +++ b/graphene/types/tests/test_scalars.py @@ -1,8 +1,10 @@ import datetime + import pytest from graphene.utils.get_graphql_type import get_graphql_type -from graphql import GraphQLBoolean, GraphQLFloat, GraphQLInt, GraphQLString, GraphQLScalarType, graphql +from graphql import (GraphQLBoolean, GraphQLFloat, GraphQLInt, + GraphQLScalarType, GraphQLString, graphql) from graphql.language import ast from ..field import Field @@ -12,6 +14,7 @@ from ..schema import Schema class DatetimeScalar(Scalar): + class Meta: name = 'DateTime' @@ -53,6 +56,7 @@ GraphQLDateTimeType = GraphQLScalarType( class DatetimeScalarGraphQL(Scalar): + class Meta: graphql_type = GraphQLDateTimeType diff --git a/graphene/utils/copy_fields.py b/graphene/utils/copy_fields.py index 9d63a0ef..9ae95f50 100644 --- a/graphene/utils/copy_fields.py +++ b/graphene/utils/copy_fields.py @@ -1,4 +1,5 @@ from collections import OrderedDict + from ..types.field import Field, InputField