From: jazzthief Date: Thu, 19 Jan 2023 17:05:56 +0000 (+0100) Subject: Add precedence test for NOT X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b12ad0f788d93a210ea60efdcb7d7330907683c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Add precedence test for NOT --- diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index 3424f3ab3f..b426aba8a4 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -1768,6 +1768,15 @@ class OperatorPrecedenceTest(fixtures.TestBase, testing.AssertsCompiledSQL): self.assert_compile(op2, "mytable.myid hoho :myid_1 lala :param_1") self.assert_compile(op3, "(mytable.myid hoho :myid_1) lala :param_1") + def test_bitwise_not_precedence(self): + op1 = operators.bitwise_not_op + c = self.table1.c.myid + op2 = op1(c).op("lala", precedence=6)(4) + op3 = op1(c).op("lala", precedence=8)(4) + + self.assert_compile(op2, "~mytable.myid lala :param_1") + self.assert_compile(op3, "(~mytable.myid) lala :param_1") + @testing.combinations( ("xor", operators.bitwise_xor_op, "^"), ("or", operators.bitwise_or_op, "|"),