diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-05-05 16:36:08 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-05-05 16:36:08 +0000 |
| commit | 03d922d4ee35d6a02ffe4f06dc2fd2670c4f3f50 (patch) | |
| tree | 784c56748b4e3a9f8ec7b3ddc9181a7c5d36cef1 /lib/sqlalchemy/testing | |
| parent | b5927dd9229d9ce85fc2ba25dad10ecbb749195c (diff) | |
| parent | 5af854606b6aabb7eb07311572acafe01cc73737 (diff) | |
| download | sqlalchemy-03d922d4ee35d6a02ffe4f06dc2fd2670c4f3f50.tar.gz | |
Merge "Parenthesize for empty not in"
Diffstat (limited to 'lib/sqlalchemy/testing')
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_select.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index 8133c2105..1605033a0 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -1110,6 +1110,26 @@ class ExpandingBoundInTest(fixtures.TablesTest): ) self._assert_result(stmt, [(2,), (3,), (4,)]) + def test_nonempty_in_plus_empty_notin(self): + table = self.tables.some_table + stmt = ( + select(table.c.id) + .where(table.c.x.in_([2, 3])) + .where(table.c.id.not_in([])) + .order_by(table.c.id) + ) + self._assert_result(stmt, [(2,), (3,)]) + + def test_empty_in_plus_notempty_notin(self): + table = self.tables.some_table + stmt = ( + select(table.c.id) + .where(table.c.x.in_([])) + .where(table.c.id.not_in([2, 3])) + .order_by(table.c.id) + ) + self._assert_result(stmt, []) + @testing.requires.tuple_in def test_bound_in_two_tuple_bindparam(self): table = self.tables.some_table |
