Skip to content

Commit 5b40324

Browse files
authored
Reorganize Tests (#985)
We no longer need a dedicated folder for Python3.6+ tests We no longer need to check six.PY3 in tests
1 parent 9234016 commit 5b40324

File tree

8 files changed

+19
-100
lines changed

8 files changed

+19
-100
lines changed

graphene/types/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1+
from typing import Type
2+
13
from ..utils.subclass_with_meta import SubclassWithMeta
24
from ..utils.trim_docstring import trim_docstring
3-
import six
4-
5-
if six.PY3:
6-
from typing import Type
75

86

97
class BaseOptions(object):

graphene/types/scalars.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import six
2+
from typing import Any
3+
24
from graphql.language.ast import BooleanValue, FloatValue, IntValue, StringValue
35

46
from .base import BaseOptions, BaseType
57
from .unmountedtype import UnmountedType
68

7-
if six.PY3:
8-
from typing import Any
9-
109

1110
class ScalarOptions(BaseOptions):
1211
pass

graphene/types/tests/test_enum.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import six
2-
31
from ..argument import Argument
42
from ..enum import Enum, PyEnum
53
from ..field import Field
@@ -115,9 +113,6 @@ class Query(ObjectType):
115113

116114

117115
def test_enum_from_python3_enum_uses_enum_doc():
118-
if not six.PY3:
119-
return
120-
121116
from enum import Enum as PyEnum
122117

123118
class Color(PyEnum):

graphene/types/tests/test_objecttype.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,17 @@ class Meta:
265265
field = MyScalar()
266266

267267
assert str(MyObjectType) == "MyObjectType"
268+
269+
270+
def test_objecttype_meta_with_annotations():
271+
class Query(ObjectType):
272+
class Meta:
273+
name: str = "oops"
274+
275+
hello = String()
276+
277+
def resolve_hello(self, info):
278+
return "Hello"
279+
280+
schema = Schema(query=Query)
281+
assert schema is not None

graphene/utils/annotate.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

graphene/utils/tests/test_annotate.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

tests_py36/test_objecttype.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ deps =
99
setenv =
1010
PYTHONPATH = .:{envdir}
1111
commands =
12-
py{36,37}: py.test --cov=graphene graphene examples tests_asyncio tests_py36 {posargs}
12+
py{36,37}: py.test --cov=graphene graphene examples tests_asyncio {posargs}
1313

1414
[testenv:pre-commit]
1515
basepython=python3.6

0 commit comments

Comments
 (0)