Skip to content

Commit

Permalink
Reorganize Tests (#985)
Browse files Browse the repository at this point in the history
We no longer need a dedicated folder for Python3.6+ tests
We no longer need to check six.PY3 in tests
  • Loading branch information
ekampf committed Jun 2, 2019
1 parent 9234016 commit 5b40324
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 100 deletions.
6 changes: 2 additions & 4 deletions graphene/types/base.py
@@ -1,9 +1,7 @@
from typing import Type

from ..utils.subclass_with_meta import SubclassWithMeta
from ..utils.trim_docstring import trim_docstring
import six

if six.PY3:
from typing import Type


class BaseOptions(object):
Expand Down
5 changes: 2 additions & 3 deletions graphene/types/scalars.py
@@ -1,12 +1,11 @@
import six
from typing import Any

from graphql.language.ast import BooleanValue, FloatValue, IntValue, StringValue

from .base import BaseOptions, BaseType
from .unmountedtype import UnmountedType

if six.PY3:
from typing import Any


class ScalarOptions(BaseOptions):
pass
Expand Down
5 changes: 0 additions & 5 deletions graphene/types/tests/test_enum.py
@@ -1,5 +1,3 @@
import six

from ..argument import Argument
from ..enum import Enum, PyEnum
from ..field import Field
Expand Down Expand Up @@ -115,9 +113,6 @@ class Query(ObjectType):


def test_enum_from_python3_enum_uses_enum_doc():
if not six.PY3:
return

from enum import Enum as PyEnum

class Color(PyEnum):
Expand Down
14 changes: 14 additions & 0 deletions graphene/types/tests/test_objecttype.py
Expand Up @@ -265,3 +265,17 @@ class Meta:
field = MyScalar()

assert str(MyObjectType) == "MyObjectType"


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
35 changes: 0 additions & 35 deletions graphene/utils/annotate.py

This file was deleted.

37 changes: 0 additions & 37 deletions graphene/utils/tests/test_annotate.py

This file was deleted.

15 changes: 0 additions & 15 deletions tests_py36/test_objecttype.py

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -9,7 +9,7 @@ deps =
setenv =
PYTHONPATH = .:{envdir}
commands =
py{36,37}: py.test --cov=graphene graphene examples tests_asyncio tests_py36 {posargs}
py{36,37}: py.test --cov=graphene graphene examples tests_asyncio {posargs}

[testenv:pre-commit]
basepython=python3.6
Expand Down

0 comments on commit 5b40324

Please sign in to comment.