coercions.expect(roles.WhereHavingRole, clause)
for clause in util.coerce_generator_arg(clauses)
]
+
+ if len(clauses) == 0:
+ util.warn_deprecated(
+ "Calling %s without any argument is deprecated singe version "
+ "1.4 since it can produce ambiguous behaviour. A future "
+ "version of sqlalchemy will raise an exception in this case"
+ % operator.__name__
+ )
+
for clause in clauses:
if isinstance(clause, continue_on):
from sqlalchemy.sql.expression import UnaryExpression
from sqlalchemy.sql.expression import union
from sqlalchemy.testing import assert_raises_message
+from sqlalchemy.testing import combinations
from sqlalchemy.testing import eq_
+from sqlalchemy.testing import expect_deprecated
from sqlalchemy.testing import expect_warnings
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import is_
self.assert_compile(or_(True, False), "true")
+ @combinations(and_, or_)
+ def test_empty_clauses(self, op):
+ with expect_deprecated(
+ "Calling %s without any argument is deprecated singe version "
+ "1.4 since it can produce ambiguous behaviour. A future "
+ "version of sqlalchemy will raise an exception in this case"
+ % op.__name__
+ ):
+ op()
+
class OperatorPrecedenceTest(fixtures.TestBase, testing.AssertsCompiledSQL):
__dialect__ = "default"