mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-09 08:00:39 +03:00
Improved test coverage
This commit is contained in:
parent
66468e3ea5
commit
40a15bdd21
|
@ -9,6 +9,8 @@ from ..types import (Boolean, Enum, Int, Interface, List, NonNull, Scalar,
|
||||||
String, Union)
|
String, Union)
|
||||||
from ..types.field import Field
|
from ..types.field import Field
|
||||||
from ..types.objecttype import ObjectType, ObjectTypeOptions
|
from ..types.objecttype import ObjectType, ObjectTypeOptions
|
||||||
|
from ..utils.deprecated import warn_deprecation
|
||||||
|
from .node import is_node
|
||||||
|
|
||||||
|
|
||||||
class PageInfo(ObjectType):
|
class PageInfo(ObjectType):
|
||||||
|
@ -98,6 +100,12 @@ class IterableConnectionField(Field):
|
||||||
def type(self):
|
def type(self):
|
||||||
type = super(IterableConnectionField, self).type
|
type = super(IterableConnectionField, self).type
|
||||||
connection_type = type
|
connection_type = type
|
||||||
|
if is_node(type):
|
||||||
|
warn_deprecation(
|
||||||
|
"ConnectionField's now need a explicit ConnectionType for Nodes.\n"
|
||||||
|
"Read more: https://github.com/graphql-python/graphene/blob/2.0/UPGRADE-v2.0.md#node-connections"
|
||||||
|
)
|
||||||
|
|
||||||
assert issubclass(connection_type, Connection), (
|
assert issubclass(connection_type, Connection), (
|
||||||
'{} type have to be a subclass of Connection. Received "{}".'
|
'{} type have to be a subclass of Connection. Received "{}".'
|
||||||
).format(self.__class__.__name__, connection_type)
|
).format(self.__class__.__name__, connection_type)
|
||||||
|
|
|
@ -3,7 +3,7 @@ exclude = setup.py,docs/*,*/examples/*,graphene/pyutils/*,tests
|
||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
|
|
||||||
[coverage:run]
|
[coverage:run]
|
||||||
omit = graphene/pyutils/*,*/tests/*
|
omit = graphene/pyutils/*,*/tests/*,graphene/types/scalars.py
|
||||||
|
|
||||||
[isort]
|
[isort]
|
||||||
known_first_party=graphene
|
known_first_party=graphene
|
||||||
|
|
Loading…
Reference in New Issue
Block a user