From e34bb409197d72711ae2c6197f9d8305533034d4 Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Mon, 30 Aug 2021 23:14:27 +0200 Subject: bpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074) --- Lib/sqlite3/test/dbapi.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Lib/sqlite3/test/dbapi.py') diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index 02e42e8c375..89f773daf24 100644 --- a/Lib/sqlite3/test/dbapi.py +++ b/Lib/sqlite3/test/dbapi.py @@ -880,6 +880,13 @@ class ExtensionTests(unittest.TestCase): with self.assertRaises(sqlite.DataError): cur.executescript("create table a(s);".ljust(size)) + def test_cursor_executescript_tx_control(self): + con = sqlite.connect(":memory:") + con.execute("begin") + self.assertTrue(con.in_transaction) + con.executescript("select 1") + self.assertFalse(con.in_transaction) + def test_connection_execute(self): con = sqlite.connect(":memory:") result = con.execute("select 5").fetchone()[0] -- cgit v1.2.3