MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_in_values

Method test_in_values

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

Source from the content-addressed store, hash-verified

2769
2770 @testing.combinations(lambda v: v, lambda v: v.scalar_values())
2771 def test_in_values(self, scalar):
2772 t1, t2 = self.table1, self.table2
2773 v = scalar(values(t2.c.otherid).data([(1,), (42,)]))
2774 self.assert_compile(
2775 select(t1.c.myid.in_(v)),
2776 "SELECT mytable.myid IN (VALUES (:param_1), (:param_2)) "
2777 "AS anon_1 FROM mytable",
2778 params={"param_1": 1, "param_2": 42},
2779 )
2780 self.assert_compile(
2781 select(t1.c.myid.not_in(v)),
2782 "SELECT (mytable.myid NOT IN (VALUES (:param_1), (:param_2))) "
2783 "AS anon_1 FROM mytable",
2784 params={"param_1": 1, "param_2": 42},
2785 )
2786
2787
2788class 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