MCPcopy Index your code
hub / github.com/RustPython/RustPython / setUp

Method setUp

Lib/test/test_sqlite3/test_userfunctions.py:147–168  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

145
146class 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()

Callers

nothing calls this directly

Calls 5

isinstanceFunction · 0.85
lenFunction · 0.85
create_functionMethod · 0.80
connectMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected