def _test(self, fn, arg, offending_clause): arg = util.to_list(arg) assert_raises_message( exc.ArgumentError, r"Textual (?:SQL|column|SQL FROM) expression %(stmt)r should be " r"explicitly declared (?:with|as) text\(%(stmt)r\)" % {"stmt": util.ellipses_string(offending_clause)}, fn, *arg)
def _test(self, fn, arg, offending_clause, expected): with expect_warnings("Textual "): stmt = fn(arg) self.assert_compile(stmt, expected) assert_raises_message( exc.SAWarning, r"Textual (?:SQL|column|SQL FROM) expression %(stmt)r should be " r"explicitly declared (?:with|as) text\(%(stmt)r\)" % { "stmt": util.ellipses_string(offending_clause), }, fn, arg)
def _test(self, fn, arg, offending_clause, expected): with expect_warnings("Textual "): stmt = fn(arg) self.assert_compile(stmt, expected) assert_raises_message( exc.SAWarning, r"Textual (?:SQL|column|SQL FROM) expression %(stmt)r should be " r"explicitly declared (?:with|as) text\(%(stmt)r\)" % {"stmt": util.ellipses_string(offending_clause)}, fn, arg, )