From 41a38bfe38d8b66da853012e7165cc0cacf7f28a Mon Sep 17 00:00:00 2001 From: Shamil Date: Wed, 19 Nov 2025 09:41:19 +0300 Subject: [PATCH] Add typing test for issue #12730 --- .../plain_files/sql/common_sql_element.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/typing/plain_files/sql/common_sql_element.py b/test/typing/plain_files/sql/common_sql_element.py index e8a10e553d..bad13b014e 100644 --- a/test/typing/plain_files/sql/common_sql_element.py +++ b/test/typing/plain_files/sql/common_sql_element.py @@ -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]) -- 2.47.3