(self)
| 36 | __dialect__ = "default" |
| 37 | |
| 38 | def test_column(self): |
| 39 | class MyThingy(ColumnClause): |
| 40 | inherit_cache = False |
| 41 | |
| 42 | def __init__(self, arg=None): |
| 43 | super().__init__(arg or "MYTHINGY!") |
| 44 | |
| 45 | @compiles(MyThingy) |
| 46 | def visit_thingy(thingy, compiler, **kw): |
| 47 | return ">>%s<<" % thingy.name |
| 48 | |
| 49 | self.assert_compile( |
| 50 | select(column("foo"), MyThingy()), "SELECT foo, >>MYTHINGY!<<" |
| 51 | ) |
| 52 | |
| 53 | self.assert_compile( |
| 54 | select(MyThingy("x"), MyThingy("y")).where(MyThingy() == 5), |
| 55 | "SELECT >>x<<, >>y<< WHERE >>MYTHINGY!<< = :MYTHINGY!_1", |
| 56 | ) |
| 57 | |
| 58 | def test_create_column_skip(self): |
| 59 | @compiles(CreateColumn) |
nothing calls this directly
no test coverage detected