(self)
| 145 | |
| 146 | class FunctionTests(unittest.TestCase): |
| 147 | def setUp(self): |
| 148 | self.con = sqlite.connect(":memory:") |
| 149 | |
| 150 | self.con.create_function("returntext", 0, func_returntext) |
| 151 | self.con.create_function("returntextwithnull", 0, func_returntextwithnull) |
| 152 | self.con.create_function("returnunicode", 0, func_returnunicode) |
| 153 | self.con.create_function("returnint", 0, func_returnint) |
| 154 | self.con.create_function("returnfloat", 0, func_returnfloat) |
| 155 | self.con.create_function("returnnull", 0, func_returnnull) |
| 156 | self.con.create_function("returnblob", 0, func_returnblob) |
| 157 | self.con.create_function("returnlonglong", 0, func_returnlonglong) |
| 158 | self.con.create_function("returnnan", 0, lambda: float("nan")) |
| 159 | self.con.create_function("return_noncont_blob", 0, |
| 160 | lambda: memoryview(b"blob")[::2]) |
| 161 | self.con.create_function("raiseexception", 0, func_raiseexception) |
| 162 | self.con.create_function("memoryerror", 0, func_memoryerror) |
| 163 | self.con.create_function("overflowerror", 0, func_overflowerror) |
| 164 | |
| 165 | self.con.create_function("isblob", 1, lambda x: isinstance(x, bytes)) |
| 166 | self.con.create_function("isnone", 1, lambda x: x is None) |
| 167 | self.con.create_function("spam", -1, lambda *x: len(x)) |
| 168 | self.con.execute("create table test(t text)") |
| 169 | |
| 170 | def tearDown(self): |
| 171 | self.con.close() |
nothing calls this directly
no test coverage detected