[Python-checkins] bpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074)

pablogsal webhook-mailer at python.org
Mon Aug 30 17:14:33 EDT 2021


https://github.com/python/cpython/commit/e34bb409197d72711ae2c6197f9d8305533034d4
commit: e34bb409197d72711ae2c6197f9d8305533034d4
branch: main
author: Erlend Egeberg Aasland <erlend.aasland at innova.no>
committer: pablogsal <Pablogsal at gmail.com>
date: 2021-08-30T22:14:27+01:00
summary:

bpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074)

files:
M Lib/sqlite3/test/dbapi.py

diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index 02e42e8c3751f..89f773daf24a1 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -880,6 +880,13 @@ def test_cursor_executescript_too_large_script(self, maxsize):
             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]



More information about the Python-checkins mailing list