diff options
author | Ćukasz Langa <lukasz@langa.pl> | 2022-11-21 20:44:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 20:44:17 (GMT) |
commit | 2781ec9b0e41a62cecc189c22dfc849f9a56927c (patch) | |
tree | 9c3f89e14db3d8c76eae2aa1a2be4825d0ac5d57 /Lib/test/test_sqlite3 | |
parent | 49e554dbafc87245c1364ae00ad064a96f5cb995 (diff) | |
download | cpython-2781ec9b0e41a62cecc189c22dfc849f9a56927c.zip cpython-2781ec9b0e41a62cecc189c22dfc849f9a56927c.tar.gz cpython-2781ec9b0e41a62cecc189c22dfc849f9a56927c.tar.bz2 |
gh-99659: Use correct exceptions in sqlite3 bigmem tests (#99660)
The tests in question were added in 0eec6276fdcd 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.
Diffstat (limited to 'Lib/test/test_sqlite3')
-rw-r--r-- | Lib/test/test_sqlite3/test_types.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_sqlite3/test_types.py b/Lib/test/test_sqlite3/test_types.py index 6231882..5e0ff35 100644 --- a/Lib/test/test_sqlite3/test_types.py +++ b/Lib/test/test_sqlite3/test_types.py @@ -106,9 +106,9 @@ class SqliteTypeTests(unittest.TestCase): @unittest.skipUnless(sys.maxsize > 2**32, 'requires 64bit platform') @support.bigmemtest(size=2**31, memuse=4, dry_run=False) def test_too_large_string(self, maxsize): - with self.assertRaises(sqlite.InterfaceError): + with self.assertRaises(sqlite.DataError): self.cur.execute("insert into test(s) values (?)", ('x'*(2**31-1),)) - with self.assertRaises(OverflowError): + with self.assertRaises(sqlite.DataError): self.cur.execute("insert into test(s) values (?)", ('x'*(2**31),)) self.cur.execute("select 1 from test") row = self.cur.fetchone() @@ -117,9 +117,9 @@ class SqliteTypeTests(unittest.TestCase): @unittest.skipUnless(sys.maxsize > 2**32, 'requires 64bit platform') @support.bigmemtest(size=2**31, memuse=3, dry_run=False) def test_too_large_blob(self, maxsize): - with self.assertRaises(sqlite.InterfaceError): + with self.assertRaises(sqlite.DataError): self.cur.execute("insert into test(s) values (?)", (b'x'*(2**31-1),)) - with self.assertRaises(OverflowError): + with self.assertRaises(sqlite.DataError): self.cur.execute("insert into test(s) values (?)", (b'x'*(2**31),)) self.cur.execute("select 1 from test") row = self.cur.fetchone() |