Update pre-commit and fix existing flake8 warnings once for all

This commit is contained in:
Bastien Gérard
2020-04-25 21:36:07 +02:00
parent 1312100bc7
commit ef7da36ac6
9 changed files with 43 additions and 45 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import pytest
from bson import InvalidDocument
import pytest
from mongoengine import *
from mongoengine.base import BaseDict

View File

@@ -152,7 +152,7 @@ class TestLazyReferenceField(MongoDBTestCase):
LazyReference(BadDoc, animal.pk),
):
with pytest.raises(ValidationError):
p = Ocurrence(person="test", animal=bad).save()
Ocurrence(person="test", animal=bad).save()
def test_lazy_reference_query_conversion(self):
"""Ensure that LazyReferenceFields can be queried using objects and values
@@ -386,7 +386,7 @@ class TestGenericLazyReferenceField(MongoDBTestCase):
mineral = Mineral(name="Granite").save()
occ_animal = Ocurrence(living_thing=animal, thing=animal).save()
occ_vegetal = Ocurrence(living_thing=vegetal, thing=vegetal).save()
_ = Ocurrence(living_thing=vegetal, thing=vegetal).save()
with pytest.raises(ValidationError):
Ocurrence(living_thing=mineral).save()
@@ -458,7 +458,7 @@ class TestGenericLazyReferenceField(MongoDBTestCase):
baddoc = BadDoc().save()
for bad in (42, "foo", baddoc, LazyReference(BadDoc, animal.pk)):
with pytest.raises(ValidationError):
p = Ocurrence(person="test", animal=bad).save()
Ocurrence(person="test", animal=bad).save()
def test_generic_lazy_reference_query_conversion(self):
class Member(Document):