mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-25 11:03:58 +03:00
* Replicate error with test * Fix - ignore parameters we do not recognize * Seperate Python3.6+ tests to their own folder * lint * Unused import * Black formatting
This commit is contained in:
parent
1fcdeaac65
commit
eb7966eca7
|
@ -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
|
||||
|
|
15
tests_py36/test_objecttype.py
Normal file
15
tests_py36/test_objecttype.py
Normal file
|
@ -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
|
3
tox.ini
3
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user