]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
test select(<table>.c) in legacy select
authorOliver Rice <github@oliverrice.com>
Sat, 13 Feb 2021 00:13:17 +0000 (18:13 -0600)
committerOliver Rice <github@oliverrice.com>
Sat, 13 Feb 2021 00:13:17 +0000 (18:13 -0600)
test/sql/test_deprecations.py

index ea354ddd7e11f5abe7d2d385bdee804ed7c78309..3a6da1d13d324755694b75ce96dabe16a381fb59 100644 (file)
@@ -446,6 +446,16 @@ class SelectableTest(fixtures.TestBase, AssertsCompiledSQL):
             stmt = select(iter([column("q")]))
         self.assert_compile(stmt, "SELECT q")
 
+    def test_select_immutable_column_collection_argument(self):
+        t1 = table("t1", column("q"))
+
+        with testing.expect_deprecated_20(
+            r"The legacy calling style of select\(\) is deprecated "
+            "and will be removed in SQLAlchemy 2.0"
+        ):
+            stmt = select(t1.c)
+        self.assert_compile(stmt, "SELECT t1.q FROM t1")
+
     def test_select_kw_argument(self):
 
         with testing.expect_deprecated_20(