From: Federico Caselli Date: Sun, 29 Dec 2019 18:54:20 +0000 (+0100) Subject: Improve test for empty and_ or_ X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ca2f27281977d74e390148c0fb8deaa0e0e4ad9;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Improve test for empty and_ or_ --- 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")),