]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add rule to prevent "GROUP BY <expr>" in tests
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 4 Jan 2018 15:44:53 +0000 (10:44 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 4 Jan 2018 15:44:53 +0000 (10:44 -0500)
Added a new exclusion rule group_by_complex_expression
which disables tests that use "GROUP BY <expr>", which seems
to be not viable for at least two third party dialects.

Change-Id: I47284513382ae93f5a3d12c734b3a44643147c99

doc/build/changelog/unreleased_12/groupby_rule.rst [new file with mode: 0644]
lib/sqlalchemy/testing/requirements.py
lib/sqlalchemy/testing/suite/test_select.py

diff --git a/doc/build/changelog/unreleased_12/groupby_rule.rst b/doc/build/changelog/unreleased_12/groupby_rule.rst
new file mode 100644 (file)
index 0000000..c012f57
--- /dev/null
@@ -0,0 +1,6 @@
+.. change::
+    :tags: bug, tests
+
+    Added a new exclusion rule group_by_complex_expression
+    which disables tests that use "GROUP BY <expr>", which seems
+    to be not viable for at least two third party dialects.
index 0b89a4506c7085238e56c4cfeca0aa84077b4219..b89d149d698d702893c937834d7f8422092e55c0 100644 (file)
@@ -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):
index 0972148233a80a4ebc9a05002216e17d187b6014..df638c140d240aa16f9ed77ab0c8c6c117e1595f 100644 (file)
@@ -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')