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

Method test_table_valued_advice

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

Source from the content-addressed store, hash-verified

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