flake8 tweaks to mongoengine.fields + ignore tests for now

This commit is contained in:
Stefan Wojcik 2016-11-28 16:06:38 -05:00
parent c72465cbb4
commit e2097061e9
2 changed files with 16 additions and 18 deletions

View File

@ -8,6 +8,9 @@ import uuid
import warnings import warnings
from operator import itemgetter from operator import itemgetter
from bson import Binary, DBRef, ObjectId, SON
import gridfs
import pymongo
import six import six
try: try:
@ -17,22 +20,18 @@ except ImportError:
else: else:
import dateutil.parser import dateutil.parser
import pymongo
import gridfs
from bson import Binary, DBRef, SON, ObjectId
try: try:
from bson.int64 import Int64 from bson.int64 import Int64
except ImportError: except ImportError:
Int64 = long Int64 = long
from mongoengine.errors import ValidationError, DoesNotExist from .base import (BaseDocument, BaseField, ComplexBaseField, GeoJsonBaseField,
from mongoengine.python_support import (PY3, bin_type, txt_type, ObjectIdField, get_document)
str_types, StringIO) from .connection import DEFAULT_CONNECTION_NAME, get_db
from base import (BaseField, ComplexBaseField, ObjectIdField, GeoJsonBaseField, from .document import Document, EmbeddedDocument
get_document, BaseDocument) from .errors import DoesNotExist, ValidationError
from queryset import DO_NOTHING, QuerySet from .python_support import PY3, StringIO, bin_type, str_types, txt_type
from document import Document, EmbeddedDocument from .queryset import DO_NOTHING, QuerySet
from connection import get_db, DEFAULT_CONNECTION_NAME
try: try:
from PIL import Image, ImageOps from PIL import Image, ImageOps
@ -1015,11 +1014,10 @@ class ReferenceField(BaseField):
if self.document_type._meta.get('abstract') and \ if self.document_type._meta.get('abstract') and \
not isinstance(value, self.document_type): not isinstance(value, self.document_type):
self.error('%s is not an instance of abstract reference' self.error(
' type %s' % (value._class_name, '%s is not an instance of abstract reference type %s' % (
self.document_type._class_name) self.document_type._class_name)
) )
def lookup_member(self, member_name): def lookup_member(self, member_name):
return self.document_type._fields.get(member_name) return self.document_type._fields.get(member_name)

View File

@ -8,6 +8,6 @@ tests = tests
[flake8] [flake8]
ignore=E501,F401,F403,F405,I201 ignore=E501,F401,F403,F405,I201
exclude=build,dist,docs,venv,.tox,.eggs exclude=build,dist,docs,venv,.tox,.eggs,tests
max-complexity=25 max-complexity=25
application-import-names=mongoengine,tests application-import-names=mongoengine,tests