diff options
Diffstat (limited to 'Lib/test/test_sqlite3/test_dbapi.py')
-rw-r--r-- | Lib/test/test_sqlite3/test_dbapi.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index 6628eee975d..a5ec66fe22a 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -55,7 +55,7 @@ def memory_database(): # Temporarily limit a database connection parameter @contextlib.contextmanager -def cx_limit(cx, category=sqlite.SQLITE_LIMIT_LENGTH, limit=128): +def cx_limit(cx, category=sqlite.SQLITE_LIMIT_SQL_LENGTH, limit=128): try: _prev = cx.setlimit(category, limit) yield limit @@ -495,7 +495,7 @@ class ConnectionTests(unittest.TestCase): prev_limit = self.cx.setlimit(category, new_limit) self.assertEqual(saved_limit, prev_limit) self.assertEqual(self.cx.getlimit(category), new_limit) - msg = "string or blob too big" + msg = "query string is too large" self.assertRaisesRegex(sqlite.DataError, msg, self.cx.execute, "select 1 as '16'") finally: # restore saved limit @@ -1063,9 +1063,9 @@ class ExtensionTests(unittest.TestCase): def test_cursor_executescript_too_large_script(self): msg = "query string is too large" with memory_database() as cx, cx_limit(cx) as lim: - cx.executescript("select 'almost too large'".ljust(lim-1)) + cx.executescript("select 'almost too large'".ljust(lim)) with self.assertRaisesRegex(sqlite.DataError, msg): - cx.executescript("select 'too large'".ljust(lim)) + cx.executescript("select 'too large'".ljust(lim+1)) def test_cursor_executescript_tx_control(self): con = sqlite.connect(":memory:") |