]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add typing test for issue #12730 12988/head
authorShamil <ashm.tech@proton.me>
Wed, 19 Nov 2025 06:41:19 +0000 (09:41 +0300)
committerShamil <ashm.tech@proton.me>
Wed, 19 Nov 2025 06:41:19 +0000 (09:41 +0300)
test/typing/plain_files/sql/common_sql_element.py

index e8a10e553db85adb4d238e413774ed068c6add7b..bad13b014ed0ee12b6ee5a7f3180b358e3a9b324 100644 (file)
@@ -163,6 +163,24 @@ user = session.query(user_table).with_for_update(
     of=[user_table.c.id, user_table.c.email]
 )
 
+# test 12730 - tuples of DeclarativeBase classes
+
+
+class A(Base):
+    __tablename__ = "a"
+    id: Mapped[int] = mapped_column(primary_key=True)
+
+
+class B(Base):
+    __tablename__ = "b"
+    id: Mapped[int] = mapped_column(primary_key=True)
+
+
+s12730_1 = select(A, B).with_for_update(of=(A, B))
+s12730_2 = select(A, B).with_for_update(of=(A,))
+s12730_3 = select(A, B).with_for_update(of=[A, B])
+s12730_4 = session.query(A, B).with_for_update(of=(A, B))
+
 # literal
 assert_type(literal("5"), BindParameter[str])
 assert_type(literal("5", None), BindParameter[str])