summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2022-11-03 20:52:21 +0100
committerFederico Caselli <cfederico87@gmail.com>2022-11-16 23:03:04 +0100
commit4eb4ceca36c7ce931ea65ac06d6ed08bf459fc66 (patch)
tree4970cff3f78489a4a0066cd27fd4bae682402957 /examples
parent3fc6c40ea77c971d3067dab0fdf57a5b5313b69b (diff)
downloadsqlalchemy-4eb4ceca36c7ce931ea65ac06d6ed08bf459fc66.tar.gz
Try running pyupgrade on the code
command run is "pyupgrade --py37-plus --keep-runtime-typing --keep-percent-format <files...>" pyupgrade will change assert_ to assertTrue. That was reverted since assertTrue does not exists in sqlalchemy fixtures Change-Id: Ie1ed2675c7b11d893d78e028aad0d1576baebb55
Diffstat (limited to 'examples')
-rw-r--r--examples/association/dict_of_sets_with_default.py2
-rw-r--r--examples/materialized_paths/materialized_paths.py2
-rw-r--r--examples/versioned_rows/versioned_update_old_row.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/examples/association/dict_of_sets_with_default.py b/examples/association/dict_of_sets_with_default.py
index 96e30c1e2..f515ab975 100644
--- a/examples/association/dict_of_sets_with_default.py
+++ b/examples/association/dict_of_sets_with_default.py
@@ -87,7 +87,7 @@ if __name__ == "__main__":
# only "A" is referenced explicitly. Using "collections",
# we deal with a dict of key/sets of integers directly.
- session.add_all([A(collections={"1": set([1, 2, 3])})])
+ session.add_all([A(collections={"1": {1, 2, 3}})])
session.commit()
a1 = session.query(A).first()
diff --git a/examples/materialized_paths/materialized_paths.py b/examples/materialized_paths/materialized_paths.py
index ad2a4f4a9..f458270c7 100644
--- a/examples/materialized_paths/materialized_paths.py
+++ b/examples/materialized_paths/materialized_paths.py
@@ -86,7 +86,7 @@ class Node(Base):
return len(self.path.split(".")) - 1
def __repr__(self):
- return "Node(id={})".format(self.id)
+ return f"Node(id={self.id})"
def __str__(self):
root_depth = self.depth
diff --git a/examples/versioned_rows/versioned_update_old_row.py b/examples/versioned_rows/versioned_update_old_row.py
index e1e25704c..41d3046a7 100644
--- a/examples/versioned_rows/versioned_update_old_row.py
+++ b/examples/versioned_rows/versioned_update_old_row.py
@@ -45,7 +45,7 @@ class VersionedStartEnd:
# reduce some verbosity when we make a new object
kw.setdefault("start", current_time() - datetime.timedelta(days=3))
kw.setdefault("end", current_time() + datetime.timedelta(days=3))
- super(VersionedStartEnd, self).__init__(**kw)
+ super().__init__(**kw)
def new_version(self, session):