summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_compiler.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2022-09-25 16:37:15 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2022-09-25 21:16:41 -0400
commite3a71aadd7637824e5a6937118668f304460d003 (patch)
tree28cd00e286fd3419c037501b90ef5413f7916353 /test/dialect/postgresql/test_compiler.py
parentb9e2926d661b80ee7b7c094c92cfa272d81b0b8b (diff)
downloadsqlalchemy-e3a71aadd7637824e5a6937118668f304460d003.tar.gz
`aggregate_order_by` now supports cache generation.
also adjusted CacheKeyFixture to be a general purpose fixture so that sub-components / dialects can run their own cache key tests. Fixes: #8574 Change-Id: I6c66107856aee11e548d357cea77bceee3e316a0 (cherry picked from commit 7980b677085fc759a0406f6778b9729955f3c7f6)
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index d85ae9152..897909b15 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -3347,3 +3347,36 @@ class RegexpTest(fixtures.TestBase, testing.AssertsCompiledSQL):
"SELECT 1 " + exp,
checkparams=params,
)
+
+
+class CacheKeyTest(fixtures.CacheKeyFixture, fixtures.TestBase):
+ def test_aggregate_order_by(self):
+ """test #8574"""
+
+ self._run_cache_key_fixture(
+ lambda: (
+ aggregate_order_by(column("a"), column("a")),
+ aggregate_order_by(column("a"), column("b")),
+ aggregate_order_by(column("a"), column("a").desc()),
+ aggregate_order_by(column("a"), column("a").nulls_first()),
+ aggregate_order_by(
+ column("a"), column("a").desc().nulls_first()
+ ),
+ aggregate_order_by(column("a", Integer), column("b")),
+ aggregate_order_by(column("a"), column("b"), column("c")),
+ aggregate_order_by(column("a"), column("c"), column("b")),
+ aggregate_order_by(
+ column("a"), column("b").desc(), column("c")
+ ),
+ aggregate_order_by(
+ column("a"), column("b").nulls_first(), column("c")
+ ),
+ aggregate_order_by(
+ column("a"), column("b").desc().nulls_first(), column("c")
+ ),
+ aggregate_order_by(
+ column("a", Integer), column("a"), column("b")
+ ),
+ ),
+ compare_values=False,
+ )