MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_in_values

Method test_in_values

test/sql/test_operators.py:2605–2619  ·  view source on GitHub ↗
(self, scalar)

Source from the content-addressed store, hash-verified

2603
2604 @testing.combinations(lambda v: v, lambda v: v.scalar_values())
2605 def test_in_values(self, scalar):
2606 t1, t2 = self.table1, self.table2
2607 v = scalar(values(t2.c.otherid).data([(1,), (42,)]))
2608 self.assert_compile(
2609 select(t1.c.myid.in_(v)),
2610 "SELECT mytable.myid IN (VALUES (:param_1), (:param_2)) "
2611 "AS anon_1 FROM mytable",
2612 params={"param_1": 1, "param_2": 42},
2613 )
2614 self.assert_compile(
2615 select(t1.c.myid.not_in(v)),
2616 "SELECT (mytable.myid NOT IN (VALUES (:param_1), (:param_2))) "
2617 "AS anon_1 FROM mytable",
2618 params={"param_1": 1, "param_2": 42},
2619 )
2620
2621
2622class MathOperatorTest(fixtures.TestBase, testing.AssertsCompiledSQL):

Callers

nothing calls this directly

Calls 6

valuesFunction · 0.90
selectFunction · 0.85
assert_compileMethod · 0.80
dataMethod · 0.45
in_Method · 0.45
not_inMethod · 0.45

Tested by

no test coverage detected