From 5ca2f27281977d74e390148c0fb8deaa0e0e4ad9 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Sun, 29 Dec 2019 19:54:20 +0100 Subject: [PATCH] Improve test for empty and_ or_ --- test/engine/test_execute.py | 5 +++-- test/sql/test_selectable.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py index acd309d621..133abd1a79 100644 --- a/test/engine/test_execute.py +++ b/test/engine/test_execute.py @@ -391,9 +391,10 @@ class ExecuteTest(fixtures.TestBase): for obj in ( Table("foo", MetaData(), Column("x", Integer)), Column("x", Integer), - tsa.and_(True), + # a single clause in and_ is optimized away + tsa.and_(tsa.text("1=1"), tsa.text("1=1")), + tsa.and_(tsa.text("1=1"), tsa.text("1=1")).compile(), column("foo"), - tsa.and_(True).compile(), column("foo").compile(), MetaData(), Integer(), diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py index 6156fb870b..8c15a2f42d 100644 --- a/test/sql/test_selectable.py +++ b/test/sql/test_selectable.py @@ -2678,8 +2678,9 @@ class ReprTest(fixtures.TestBase): elements.True_(), elements.False_(), elements.ClauseList(), - elements.BooleanClauseList.and_(True), - elements.BooleanClauseList.or_(False), + # a single clause in and_ | or_ is optimized away + elements.BooleanClauseList.and_(text('1=1'), text('1=1')), + elements.BooleanClauseList.or_(text('1=1'), text('1=1')), elements.Tuple(), elements.Case([]), elements.Extract("foo", column("x")), -- 2.47.3