From c86ec8f8c98b756ef06933174a3f4a0f3cfbed41 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Sun, 25 Sep 2022 16:37:15 +0200 Subject: `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 --- test/dialect/postgresql/test_compiler.py | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'test/dialect/postgresql/test_compiler.py') diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 67e54e4f5..c763dbeac 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -3465,3 +3465,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, + ) -- cgit v1.2.1