diff options
Diffstat (limited to 'lib/sqlalchemy/testing/suite/test_select.py')
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_select.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index c1f77a7c1..ad17ebb4a 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -12,6 +12,7 @@ from ..schema import Column from ..schema import Table from ... import bindparam from ... import case +from ... import column from ... import Computed from ... import false from ... import func @@ -20,6 +21,7 @@ from ... import literal_column from ... import null from ... import select from ... import String +from ... import table from ... import testing from ... import text from ... import true @@ -1016,6 +1018,19 @@ class ComputedColumnTest(fixtures.TablesTest): eq_(res, [(100, 40), (1764, 168)]) +class DistinctOnTest(AssertsCompiledSQL, fixtures.TablesTest): + __backend__ = True + __requires__ = ("standard_cursor_sql",) + + @testing.fails_if(testing.requires.supports_distinct_on) + def test_distinct_on(self): + stm = select(["*"]).distinct(column("q")).select_from(table("foo")) + with testing.expect_deprecated( + "DISTINCT ON is currently supported only by the PostgreSQL " + ): + self.assert_compile(stm, "SELECT DISTINCT * FROM foo") + + class IsOrIsNotDistinctFromTest(fixtures.TablesTest): __backend__ = True __requires__ = ("supports_is_distinct_from",) |