Skip to content

Commit c248cdd

Browse files
committed
test: Include test/ into flake8 checking
1 parent bb0f66a commit c248cdd

File tree

9 files changed

+25
-32
lines changed

9 files changed

+25
-32
lines changed

graphene_mongo/tests/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .models import (
22
Article, Editor, EmbeddedArticle, Player,
3-
Reporter, Parent, Child
3+
Reporter, Child
44
)
55

66

graphene_mongo/tests/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Editor(Document):
1919
last_name = StringField(required=True)
2020
metadata = MapField(field=StringField())
2121

22+
2223
class Pet(Document):
2324

2425
meta = {'collection': 'test_pet'}
@@ -79,4 +80,3 @@ class Child(Parent):
7980

8081
meta = {'collection': 'Child'}
8182
baz = StringField()
82-

graphene_mongo/tests/test_fields.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import pytest
2-
31
from ..fields import MongoengineConnectionField
42
from .types import ArticleNode
53

graphene_mongo/tests/test_query.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,26 @@
33
import graphene
44

55
from .fixtures import setup_fixtures
6-
from .models import Article, Editor, Player, Reporter
7-
from .types import (ArticleNode, ArticleType,
8-
EditorNode, EditorType,
9-
PlayerNode, PlayerType,
10-
ReporterNode, ReporterType)
11-
from ..fields import MongoengineConnectionField
6+
from .models import Editor, Player, Reporter
7+
from .types import (EditorType,
8+
PlayerType,
9+
ReporterType)
1210

1311
setup_fixtures()
1412

1513

1614
def test_should_query_editor():
1715

1816
class Query(graphene.ObjectType):
19-
editor = graphene.Field(EditorType)
20-
editors = graphene.List(EditorType)
2117

22-
def resolve_editor(self, *args, **kwargs):
23-
return Editor.objects.first()
18+
editor = graphene.Field(EditorType)
19+
editors = graphene.List(EditorType)
2420

25-
def resolve_editors(self, *args, **kwargs):
26-
return list(Editor.objects.all())
21+
def resolve_editor(self, *args, **kwargs):
22+
return Editor.objects.first()
23+
24+
def resolve_editors(self, *args, **kwargs):
25+
return list(Editor.objects.all())
2726

2827
query = '''
2928
query EditorQuery {
@@ -147,7 +146,7 @@ def resolve_editors(self, *args, **kwargs):
147146
}
148147
'''
149148
expected = {
150-
'editors':[
149+
'editors': [
151150
{
152151
'firstName': 'Penny',
153152
'lastName': 'Hardaway'

graphene_mongo/tests/test_relay_query.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
from graphene.relay import Node
66

77
from .fixtures import setup_fixtures
8-
from .models import Article, Editor, Player, Reporter
9-
from .types import (ArticleNode, ArticleType,
10-
EditorNode, EditorType,
11-
PlayerNode, PlayerType,
12-
ReporterNode, ReporterType,
13-
ChildNode, ChildType)
8+
from .models import Article, Reporter
9+
from .types import (ArticleNode,
10+
EditorNode,
11+
PlayerNode,
12+
ReporterNode,
13+
ChildNode,)
1414
from ..fields import MongoengineConnectionField
1515

1616
setup_fixtures()

graphene_mongo/tests/test_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Meta:
2828
model = EmbeddedArticle
2929
interfaces = (Node,)
3030

31+
3132
class Character(MongoengineObjectType):
3233

3334
class Meta:
@@ -72,6 +73,7 @@ def test_objecttype_registered():
7273
def test_mongoengine_inheritance():
7374
assert issubclass(Son._meta.model, Dad._meta.model)
7475

76+
7577
def test_node_replacedfield():
7678
idfield = Human._meta.fields['pub_date']
7779
assert isinstance(idfield, Field)
@@ -112,7 +114,6 @@ class Meta:
112114
model = Article
113115
only_fields = ('headline')
114116

115-
116117
fields = set(A._meta.fields.keys())
117118
assert fields == set(['headline'])
118119

@@ -125,4 +126,3 @@ class Meta:
125126
exclude_fields = ('headline')
126127

127128
assert 'headline' not in list(A._meta.fields.keys())
128-

graphene_mongo/tests/test_utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import pytest
2-
from mongoengine import Document
3-
4-
51
from ..utils import (
62
get_model_fields, is_valid_mongoengine_model
73
)
@@ -27,6 +23,7 @@ def test_get_model_fields_excluding():
2723
'awards'
2824
])
2925

26+
3027
def test_get_model_relation_fields():
3128
article_fields = get_model_fields(Article)
3229
assert all(field in set(article_fields) for field in ['editor', 'reporter'])
@@ -36,6 +33,6 @@ def test_get_base_model_fields():
3633
child_fields = get_model_fields(Child)
3734
assert all(field in set(child_fields) for field in ['bar', 'baz'])
3835

36+
3937
def test_is_valid_mongoengine_mode():
4038
assert is_valid_mongoengine_model(Reporter)
41-

graphene_mongo/tests/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ def inner(*args, **kwargs):
1414
registry.registry = old
1515
return retval
1616
return inner
17-

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description-file = README.md
33

44
[flake8]
5-
exclude = setup.py,docs/*,examples/*,tests
5+
exclude = setup.py,docs/*,examples/*
66
max-line-length = 130
77

88
[coverage:run]

0 commit comments

Comments
 (0)