Skip to content

Commit f04bd09

Browse files
author
Erlend E. Aasland
committed
Add test for executescript() tx ctrl
1 parent a93dcaa commit f04bd09

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/sqlite3/test/dbapi.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,13 @@ def test_cursor_executescript_too_large_script(self, maxsize):
794794
with self.assertRaises(sqlite.DataError):
795795
cur.executescript("create table a(s);".ljust(size))
796796

797+
def test_cursor_executescript_tx_control(self):
798+
con = sqlite.connect(":memory:")
799+
con.execute("begin")
800+
self.assertTrue(con.in_transaction)
801+
con.executescript("select 1")
802+
self.assertFalse(con.in_transaction)
803+
797804
def test_connection_execute(self):
798805
con = sqlite.connect(":memory:")
799806
result = con.execute("select 5").fetchone()[0]

0 commit comments

Comments
 (0)