From 43c7c4f347fa6a5a6493bd03e2233fd5d14aee9e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 4 Jan 2018 10:44:53 -0500 Subject: [PATCH] Add rule to prevent "GROUP BY " in tests Added a new exclusion rule group_by_complex_expression which disables tests that use "GROUP BY ", which seems to be not viable for at least two third party dialects. Change-Id: I47284513382ae93f5a3d12c734b3a44643147c99 --- doc/build/changelog/unreleased_12/groupby_rule.rst | 6 ++++++ lib/sqlalchemy/testing/requirements.py | 11 +++++++++++ lib/sqlalchemy/testing/suite/test_select.py | 1 + 3 files changed, 18 insertions(+) create mode 100644 doc/build/changelog/unreleased_12/groupby_rule.rst diff --git a/doc/build/changelog/unreleased_12/groupby_rule.rst b/doc/build/changelog/unreleased_12/groupby_rule.rst new file mode 100644 index 0000000000..c012f57db3 --- /dev/null +++ b/doc/build/changelog/unreleased_12/groupby_rule.rst @@ -0,0 +1,6 @@ +.. change:: + :tags: bug, tests + + Added a new exclusion rule group_by_complex_expression + which disables tests that use "GROUP BY ", which seems + to be not viable for at least two third party dialects. diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 0b89a4506c..b89d149d69 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -206,6 +206,17 @@ class SuiteRequirements(Requirements): return exclusions.open() + @property + def group_by_complex_expression(self): + """target platform supports SQL expressions in GROUP BY + + e.g. + + SELECT x + y AS somelabel FROM table GROUP BY x + y + + """ + + return exclusions.open() @property def sane_rowcount(self): diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index 0972148233..df638c140d 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -87,6 +87,7 @@ class OrderByLabelTest(fixtures.TablesTest): [(7, ), (5, ), (3, )] ) + @testing.requires.group_by_complex_expression def test_group_by_composed(self): table = self.tables.some_table expr = (table.c.x + table.c.y).label('lx') -- 2.47.3