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

Method test_no_stack

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

Source from the content-addressed store, hash-verified

210 )
211
212 def test_no_stack(self):
213 def visit_foobar(self, element, **kw):
214 self.current_executable.table
215
216 class Foobar(ClauseElement):
217 __visit_name__ = "foobar"
218
219 with mock.patch.object(
220 testing.db.dialect.statement_compiler,
221 "visit_foobar",
222 visit_foobar,
223 create=True,
224 ):
225 compiler = testing.db.dialect.statement_compiler(
226 testing.db.dialect, None
227 )
228 assert_raises_message(
229 IndexError,
230 "Compiler does not have a stack entry",
231 compiler.process,
232 Foobar(),
233 )
234
235
236class 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