(self)
| 73 | functions._registry = self._registry |
| 74 | |
| 75 | def test_compile(self): |
| 76 | for dialect in all_dialects(): |
| 77 | bindtemplate = BIND_TEMPLATES[dialect.paramstyle] |
| 78 | self.assert_compile( |
| 79 | func.current_timestamp(), "CURRENT_TIMESTAMP", dialect=dialect |
| 80 | ) |
| 81 | self.assert_compile(func.localtime(), "LOCALTIME", dialect=dialect) |
| 82 | self.assert_compile( |
| 83 | func.nosuchfunction(), "nosuchfunction()", dialect=dialect |
| 84 | ) |
| 85 | |
| 86 | # test generic function compile |
| 87 | class fake_func(GenericFunction): |
| 88 | inherit_cache = True |
| 89 | __return_type__ = sqltypes.Integer |
| 90 | |
| 91 | def __init__(self, arg, **kwargs): |
| 92 | GenericFunction.__init__(self, arg, **kwargs) |
| 93 | |
| 94 | self.assert_compile( |
| 95 | fake_func("foo"), |
| 96 | "fake_func(%s)" |
| 97 | % bindtemplate |
| 98 | % {"name": "fake_func_1", "position": 1}, |
| 99 | dialect=dialect, |
| 100 | ) |
| 101 | |
| 102 | functions._registry["_default"].pop("fake_func") |
| 103 | |
| 104 | @testing.combinations( |
| 105 | (operators.in_op, [1, 2, 3], "myfunc() IN (1, 2, 3)"), |
nothing calls this directly
no test coverage detected