Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/sqlite3/test/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down