(self, op, other, expected, use_custom)
| 109 | ) |
| 110 | @testing.combinations((True,), (False,), argnames="use_custom") |
| 111 | def test_operators_custom(self, op, other, expected, use_custom): |
| 112 | if use_custom: |
| 113 | |
| 114 | class MyFunc(FunctionElement): |
| 115 | inherit_cache = True |
| 116 | name = "myfunc" |
| 117 | type = Integer() |
| 118 | |
| 119 | @compiles(MyFunc) |
| 120 | def visit_myfunc(element, compiler, **kw): |
| 121 | return "myfunc(%s)" % compiler.process(element.clauses, **kw) |
| 122 | |
| 123 | expr = op(MyFunc(), other) |
| 124 | else: |
| 125 | expr = op(func.myfunc(type_=Integer), other) |
| 126 | |
| 127 | self.assert_compile( |
| 128 | select(1).where(expr), |
| 129 | "SELECT 1 WHERE %s" % (expected,), |
| 130 | literal_binds=True, |
| 131 | render_postcompile=True, |
| 132 | dialect="default_enhanced", |
| 133 | ) |
| 134 | |
| 135 | def test_use_labels(self): |
| 136 | self.assert_compile( |
nothing calls this directly
no test coverage detected