From 9166ba91d713924f91983cfbe959c4981e4f0711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20G=C3=A9rard?= Date: Sat, 14 Dec 2019 15:39:02 +0100 Subject: [PATCH] fix minor styling issue --- benchmarks/test_basic_doc_ops.py | 1 + mongoengine/base/datastructures.py | 2 +- setup.py | 2 +- tests/fields/test_sequence_field.py | 4 ++-- tests/test_signals.py | 4 +++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/benchmarks/test_basic_doc_ops.py b/benchmarks/test_basic_doc_ops.py index c74594fe..e840f97a 100644 --- a/benchmarks/test_basic_doc_ops.py +++ b/benchmarks/test_basic_doc_ops.py @@ -135,6 +135,7 @@ def test_big_doc(): % (timeit(create_and_delete_company, 10) * 10 ** 3) ) + if __name__ == "__main__": test_basic() print("-" * 100) diff --git a/mongoengine/base/datastructures.py b/mongoengine/base/datastructures.py index f8b4cd92..8c93f596 100644 --- a/mongoengine/base/datastructures.py +++ b/mongoengine/base/datastructures.py @@ -426,7 +426,7 @@ class StrictDict(object): return listitems(self) == listitems(other) def __ne__(self, other): - return not(self == other) + return not (self == other) @classmethod def create(cls, allowed_keys): diff --git a/setup.py b/setup.py index c6e99f53..19cd4be7 100644 --- a/setup.py +++ b/setup.py @@ -143,7 +143,7 @@ setup( long_description=LONG_DESCRIPTION, platforms=["any"], classifiers=CLASSIFIERS, - install_requires=['pymongo>=3.4', 'six', 'future'], + install_requires=["pymongo>=3.4", "six", "future"], cmdclass={"test": PyTest}, **extra_opts ) diff --git a/tests/fields/test_sequence_field.py b/tests/fields/test_sequence_field.py index 8e6615a1..81d648fd 100644 --- a/tests/fields/test_sequence_field.py +++ b/tests/fields/test_sequence_field.py @@ -267,8 +267,8 @@ class TestSequenceField(MongoDBTestCase): foo = Foo(name="Foo") foo.save() - assert ( - "base.counter" not in self.db["mongoengine.counters"].find().distinct("_id") + assert "base.counter" not in self.db["mongoengine.counters"].find().distinct( + "_id" ) existing_counters = self.db["mongoengine.counters"].find().distinct("_id") assert "foo.counter" in existing_counters diff --git a/tests/test_signals.py b/tests/test_signals.py index 13ea5a05..451e01ff 100644 --- a/tests/test_signals.py +++ b/tests/test_signals.py @@ -58,7 +58,9 @@ class TestSignal(unittest.TestCase): @classmethod def post_save(cls, sender, document, **kwargs): - dirty_keys = list(document._delta()[0].keys()) + list(document._delta()[1].keys()) + dirty_keys = list(document._delta()[0].keys()) + list( + document._delta()[1].keys() + ) signal_output.append("post_save signal, %s" % document) signal_output.append("post_save dirty keys, %s" % dirty_keys) if kwargs.pop("created", False):