run pyupgrade --py3-plus

This commit is contained in:
Bastien Gérard
2020-03-11 23:26:37 +01:00
parent b234aa48e4
commit 1e110a2c41
18 changed files with 134 additions and 144 deletions

View File

@@ -16,7 +16,7 @@ __all__ = (
)
class switch_db(object):
class switch_db:
"""switch_db alias context manager.
Example ::
@@ -57,7 +57,7 @@ class switch_db(object):
self.cls._collection = self.collection
class switch_collection(object):
class switch_collection:
"""switch_collection alias context manager.
Example ::
@@ -99,7 +99,7 @@ class switch_collection(object):
self.cls._get_collection_name = self.ori_get_collection_name
class no_dereference(object):
class no_dereference:
"""no_dereference context manager.
Turns off all dereferencing in Documents for the duration of the context
@@ -139,7 +139,7 @@ class no_dereference(object):
return self.cls
class no_sub_classes(object):
class no_sub_classes:
"""no_sub_classes context manager.
Only returns instances of this class and no sub (inherited) classes::
@@ -167,7 +167,7 @@ class no_sub_classes(object):
self.cls._subclasses = self.cls_initial_subclasses
class query_counter(object):
class query_counter:
"""Query_counter context manager to get the number of queries.
This works by updating the `profiling_level` of the database so that all queries get logged,
resetting the db.system.profile collection at the beginning of the context and counting the new entries.
@@ -234,7 +234,7 @@ class query_counter(object):
def __repr__(self):
"""repr query_counter as the number of queries."""
return u"%s" % self._get_count()
return "%s" % self._get_count()
def _get_count(self):
"""Get the number of queries by counting the current number of entries in db.system.profile