diff --git a/graphene/types/base.py b/graphene/types/base.py index 75685d98..f43feb47 100644 --- a/graphene/types/base.py +++ b/graphene/types/base.py @@ -34,7 +34,9 @@ class BaseType(SubclassWithMeta): return type(class_name, (cls,), {"Meta": options}) @classmethod - def __init_subclass_with_meta__(cls, name=None, description=None, _meta=None): + def __init_subclass_with_meta__( + cls, name=None, description=None, _meta=None, **_kwargs + ): assert "_meta" not in cls.__dict__, "Can't assign directly meta" if not _meta: return diff --git a/tests_py36/test_objecttype.py b/tests_py36/test_objecttype.py new file mode 100644 index 00000000..bce38d94 --- /dev/null +++ b/tests_py36/test_objecttype.py @@ -0,0 +1,15 @@ +from graphene import Schema, ObjectType, String + + +def test_objecttype_meta_with_annotations(): + class Query(ObjectType): + class Meta: + name: str = "oops" + + hello = String() + + def resolve_hello(self, info): + return "Hello" + + schema = Schema(query=Query) + assert schema is not None diff --git a/tox.ini b/tox.ini index c1dbd01d..57d1f78e 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,8 @@ setenv = PYTHONPATH = .:{envdir} commands = py{27,py}: py.test --cov=graphene graphene examples {posargs} - py{35,36,37}: py.test --cov=graphene graphene examples tests_asyncio {posargs} + py{35}: py.test --cov=graphene graphene examples tests_asyncio {posargs} + py{36,37}: py.test --cov=graphene graphene examples tests_asyncio tests_py36 {posargs} [testenv:pre-commit] basepython=python3.6