MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_no_default_message

Method test_no_default_message

test/ext/test_compiler.py:225–240  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

223 eq_(stmt.selected_columns.keys(), ["_no_label"])
224
225 def test_no_default_message(self):
226 class MyThingy(ClauseElement):
227 inherit_cache = False
228
229 @compiles(MyThingy, "postgresql")
230 def visit_thingy(thingy, compiler, **kw):
231 return "mythingy"
232
233 assert_raises_message(
234 exc.UnsupportedCompilationError,
235 "Compiler .*StrSQLCompiler.* can't .* "
236 "<class 'test.ext.test_compiler..*MyThingy'> "
237 "construct has no default compilation handler.",
238 str,
239 MyThingy(),
240 )
241
242 def test_default_subclass(self):
243 from sqlalchemy.types import ARRAY

Callers

nothing calls this directly

Calls 2

assert_raises_messageFunction · 0.90
MyThingyClass · 0.85

Tested by

no test coverage detected