MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_table_valued_advice

Method test_table_valued_advice

test/sql/test_roles.py:210–228  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

208 )
209
210 def test_table_valued_advice(self):
211 msg = (
212 r"SQL expression element expected, got %s. To create a "
213 r"column expression from a FROM clause row as a whole, "
214 r"use the .table_valued\(\) method."
215 )
216 assert_raises_message(
217 exc.ArgumentError,
218 msg % ("Table.*",),
219 expect,
220 roles.ExpressionElementRole,
221 t,
222 )
223
224 # no table_valued() message here right now, it goes to scalar subquery
225 with testing.expect_warnings(
226 "implicitly coercing SELECT object to scalar subquery"
227 ):
228 expect(roles.ExpressionElementRole, t.select().alias())
229
230 def test_raise_on_regular_python_obj_for_expr(self):
231 """test #6350"""

Callers

nothing calls this directly

Calls 4

assert_raises_messageFunction · 0.90
expectFunction · 0.90
aliasMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected