MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_no_stack

Method test_no_stack

test/sql/test_compiler.py:216–237  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

214 )
215
216 def test_no_stack(self):
217 def visit_foobar(self, element, **kw):
218 self.current_executable.table
219
220 class Foobar(ClauseElement):
221 __visit_name__ = "foobar"
222
223 with mock.patch.object(
224 testing.db.dialect.statement_compiler,
225 "visit_foobar",
226 visit_foobar,
227 create=True,
228 ):
229 compiler = testing.db.dialect.statement_compiler(
230 testing.db.dialect, None
231 )
232 assert_raises_message(
233 IndexError,
234 "Compiler does not have a stack entry",
235 compiler.process,
236 Foobar(),
237 )
238
239
240class SelectTest(fixtures.TestBase, AssertsCompiledSQL):

Callers

nothing calls this directly

Calls 3

assert_raises_messageFunction · 0.90
objectMethod · 0.80
FoobarClass · 0.70

Tested by

no test coverage detected