Ejemplo n.º 1
0
 def test_executescript_step_through_select(self):
     with managed_connect(":memory:", in_mem=True) as con:
         values = [(v,) for v in range(5)]
         with con:
             con.execute("create table t(t)")
             con.executemany("insert into t values(?)", values)
         steps = []
         con.create_function("step", 1, lambda x: steps.append((x,)))
         con.executescript("select step(t) from t")
         self.assertEqual(steps, values)
Ejemplo n.º 2
0
 def test_table_lock_cursor_dealloc(self):
     with managed_connect(":memory:", in_mem=True) as con:
         con.execute("create table t(t)")
         con.executemany("insert into t values(?)",
                         ((v,) for v in range(5)))
         con.commit()
         cur = con.execute("select t from t")
         del cur
         con.execute("drop table t")
         con.commit()
Ejemplo n.º 3
0
 def test_table_lock_cursor_non_readonly_select(self):
     with managed_connect(":memory:", in_mem=True) as con:
         con.execute("create table t(t)")
         con.executemany("insert into t values(?)",
                         ((v,) for v in range(5)))
         con.commit()
         def dup(v):
             con.execute("insert into t values(?)", (v,))
             return
         con.create_function("dup", 1, dup)
         cur = con.execute("select dup(t) from t")
         del cur
         con.execute("drop table t")
         con.commit()