Skip to content

Commit 3eec87c

Browse files
committed
gh-99659: Use correct exceptions in sqlite3 bigmem tests
The tests in question were added in 0eec627 by Serhiy. Apparently, sqlite3 changed exceptions raised in those cases in the mean time but the tests never ran because they require a high `-M` setting in the test runner.
1 parent c450c8c commit 3eec87c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/test/test_sqlite3/test_types.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ def test_string_with_surrogates(self):
106106
@unittest.skipUnless(sys.maxsize > 2**32, 'requires 64bit platform')
107107
@support.bigmemtest(size=2**31, memuse=4, dry_run=False)
108108
def test_too_large_string(self, maxsize):
109-
with self.assertRaises(sqlite.InterfaceError):
109+
with self.assertRaises(sqlite.DataError):
110110
self.cur.execute("insert into test(s) values (?)", ('x'*(2**31-1),))
111-
with self.assertRaises(OverflowError):
111+
with self.assertRaises(sqlite.DataError):
112112
self.cur.execute("insert into test(s) values (?)", ('x'*(2**31),))
113113
self.cur.execute("select 1 from test")
114114
row = self.cur.fetchone()
@@ -117,9 +117,9 @@ def test_too_large_string(self, maxsize):
117117
@unittest.skipUnless(sys.maxsize > 2**32, 'requires 64bit platform')
118118
@support.bigmemtest(size=2**31, memuse=3, dry_run=False)
119119
def test_too_large_blob(self, maxsize):
120-
with self.assertRaises(sqlite.InterfaceError):
120+
with self.assertRaises(sqlite.DataError):
121121
self.cur.execute("insert into test(s) values (?)", (b'x'*(2**31-1),))
122-
with self.assertRaises(OverflowError):
122+
with self.assertRaises(sqlite.DataError):
123123
self.cur.execute("insert into test(s) values (?)", (b'x'*(2**31),))
124124
self.cur.execute("select 1 from test")
125125
row = self.cur.fetchone()

0 commit comments

Comments
 (0)