diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-08-30 21:14:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-30 21:14:27 (GMT) |
commit | e34bb409197d72711ae2c6197f9d8305533034d4 (patch) | |
tree | edae9f9cf72a32ed1a962bdac67deb4f77e89d3e | |
parent | 86d8b465231473f850cc5e906013ba8581ddb503 (diff) | |
download | cpython-e34bb409197d72711ae2c6197f9d8305533034d4.zip cpython-e34bb409197d72711ae2c6197f9d8305533034d4.tar.gz cpython-e34bb409197d72711ae2c6197f9d8305533034d4.tar.bz2 |
bpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074)
-rw-r--r-- | Lib/sqlite3/test/dbapi.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index 02e42e8..89f773d 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] |