From e1129b2d3e21da8e7521211164418ebd23e46251 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 15 Aug 2015 13:52:24 -0400 Subject: - make these failure cases more specific to catch Oracle. Would be nice to fix Oracle here --- lib/sqlalchemy/testing/requirements.py | 19 +++++++++++++++++-- lib/sqlalchemy/testing/suite/test_select.py | 6 +++--- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'lib/sqlalchemy/testing') diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 8b02f3e40..15bfad831 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -111,8 +111,9 @@ class SuiteRequirements(Requirements): return exclusions.open() @property - def parens_in_union_contained_select(self): - """Target database must support parenthesized SELECT in UNION. + def parens_in_union_contained_select_w_limit_offset(self): + """Target database must support parenthesized SELECT in UNION + when LIMIT/OFFSET is specifically present. E.g. (SELECT ...) UNION (SELECT ..) @@ -121,6 +122,20 @@ class SuiteRequirements(Requirements): """ return exclusions.open() + @property + def parens_in_union_contained_select_wo_limit_offset(self): + """Target database must support parenthesized SELECT in UNION + when OFFSET/LIMIT is specifically not present. + + E.g. (SELECT ... LIMIT ..) UNION (SELECT .. OFFSET ..) + + This is known to fail on SQLite. It also fails on Oracle + because without LIMIT/OFFSET, there is currently no step that + creates an additional subquery. + + """ + return exclusions.open() + @property def boolean_col_expressions(self): """Target database must support boolean expressions as columns""" diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index 0bcd35fd2..e7de356b8 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -242,7 +242,7 @@ class CompoundSelectTest(fixtures.TablesTest): [(2, 2, 3), (3, 3, 4)] ) - @testing.requires.parens_in_union_contained_select + @testing.requires.parens_in_union_contained_select_w_limit_offset def test_limit_offset_selectable_in_unions(self): table = self.tables.some_table s1 = select([table]).where(table.c.id == 2).\ @@ -256,7 +256,7 @@ class CompoundSelectTest(fixtures.TablesTest): [(2, 2, 3), (3, 3, 4)] ) - @testing.requires.parens_in_union_contained_select + @testing.requires.parens_in_union_contained_select_wo_limit_offset def test_order_by_selectable_in_unions(self): table = self.tables.some_table s1 = select([table]).where(table.c.id == 2).\ @@ -283,7 +283,7 @@ class CompoundSelectTest(fixtures.TablesTest): [(2, 2, 3), (3, 3, 4)] ) - @testing.requires.parens_in_union_contained_select + @testing.requires.parens_in_union_contained_select_w_limit_offset def test_limit_offset_in_unions_from_alias(self): table = self.tables.some_table s1 = select([table]).where(table.c.id == 2).\ -- cgit v1.2.1