diff options
author | Federico Caselli <cfederico87@gmail.com> | 2022-09-25 16:37:15 +0200 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-09-25 21:14:48 -0400 |
commit | c86ec8f8c98b756ef06933174a3f4a0f3cfbed41 (patch) | |
tree | 35535594dd1b6436a12f69797464f8e2c090e904 /test/dialect/postgresql/test_compiler.py | |
parent | 75ab50869b37368f32ec311dfb59777c0c1d1edb (diff) | |
download | sqlalchemy-c86ec8f8c98b756ef06933174a3f4a0f3cfbed41.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
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 33 |
1 files changed, 33 insertions, 0 deletions
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, + ) |