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

Method test_in_subquery_warning

test/sql/test_operators.py:4542–4555  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4540 self.assert_compile(column("q").in_(stmt), "q IN (SELECT t.x FROM t)")
4541
4542 def test_in_subquery_warning(self):
4543 t = table("t", column("x"))
4544
4545 stmt = select(t.c.x).subquery()
4546
4547 with expect_warnings(
4548 r"Coercing Subquery object into a select\(\) for use in "
4549 r"IN\(\); please pass a select\(\) construct explicitly",
4550 ):
4551 self.assert_compile(
4552 column("q").in_(stmt),
4553 "q IN (SELECT anon_1.x FROM "
4554 "(SELECT t.x AS x FROM t) AS anon_1)",
4555 )
4556
4557 def test_in_subquery_explicit(self):
4558 t = table("t", column("x"))

Callers

nothing calls this directly

Calls 7

tableFunction · 0.90
columnFunction · 0.90
expect_warningsFunction · 0.90
selectFunction · 0.85
assert_compileMethod · 0.80
subqueryMethod · 0.45
in_Method · 0.45

Tested by

no test coverage detected