From: Shamil Date: Wed, 19 Nov 2025 06:41:19 +0000 (+0300) Subject: Add typing test for issue #12730 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41a38bfe38d8b66da853012e7165cc0cacf7f28a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Add typing test for issue #12730 --- 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])