Improve health of this package (#1409)

* added flake8 and flake8-import-order to travis for py27

* fixed a test that fails from time to time depending on an order of a dict

* flake8 tweaks for the entire codebase excluding tests
This commit is contained in:
Stefan Wójcik
2016-11-28 19:00:34 -05:00
committed by GitHub
parent 5135185e31
commit 3c455cf1c1
22 changed files with 354 additions and 299 deletions

View File

@@ -1,5 +1,5 @@
import weakref
import itertools
import weakref
from mongoengine.common import _import_class
from mongoengine.errors import DoesNotExist, MultipleObjectsReturned
@@ -199,8 +199,9 @@ class BaseList(list):
def _mark_as_changed(self, key=None):
if hasattr(self._instance, '_mark_as_changed'):
if key:
self._instance._mark_as_changed('%s.%s' % (self._name,
key % len(self)))
self._instance._mark_as_changed(
'%s.%s' % (self._name, key % len(self))
)
else:
self._instance._mark_as_changed(self._name)