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

Method setUp

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

Source from the content-addressed store, hash-verified

621
622class AggregateTests(unittest.TestCase):
623 def setUp(self):
624 self.con = sqlite.connect(":memory:")
625 cur = self.con.cursor()
626 cur.execute("""
627 create table test(
628 t text,
629 i integer,
630 f float,
631 n,
632 b blob
633 )
634 """)
635 cur.execute("insert into test(t, i, f, n, b) values (?, ?, ?, ?, ?)",
636 ("foo", 5, 3.14, None, memoryview(b"blob"),))
637 cur.close()
638
639 self.con.create_aggregate("nostep", 1, AggrNoStep)
640 self.con.create_aggregate("nofinalize", 1, AggrNoFinalize)
641 self.con.create_aggregate("excInit", 1, AggrExceptionInInit)
642 self.con.create_aggregate("excStep", 1, AggrExceptionInStep)
643 self.con.create_aggregate("excFinalize", 1, AggrExceptionInFinalize)
644 self.con.create_aggregate("checkType", 2, AggrCheckType)
645 self.con.create_aggregate("checkTypes", -1, AggrCheckTypes)
646 self.con.create_aggregate("mysum", 1, AggrSum)
647 self.con.create_aggregate("aggtxt", 1, AggrText)
648
649 def tearDown(self):
650 self.con.close()

Callers

nothing calls this directly

Calls 5

cursorMethod · 0.80
create_aggregateMethod · 0.80
connectMethod · 0.45
executeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected