Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2781ec9

Browse files
authored
gh-99659: Use correct exceptions in sqlite3 bigmem tests (#99660)
The tests in question were added in0eec627 by Serhiy. Apparently,sqlite3 changed exceptions raised in those cases in the mean time butthe tests never ran because they require a high `-M` setting in thetest runner.
1 parent49e554d commit2781ec9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

‎Lib/test/test_sqlite3/test_types.py‎

Lines changed: 4 additions & 4 deletions
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
deftest_too_large_string(self,maxsize):
109-
withself.assertRaises(sqlite.InterfaceError):
109+
withself.assertRaises(sqlite.DataError):
110110
self.cur.execute("insert into test(s) values (?)", ('x'*(2**31-1),))
111-
withself.assertRaises(OverflowError):
111+
withself.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
deftest_too_large_blob(self,maxsize):
120-
withself.assertRaises(sqlite.InterfaceError):
120+
withself.assertRaises(sqlite.DataError):
121121
self.cur.execute("insert into test(s) values (?)", (b'x'*(2**31-1),))
122-
withself.assertRaises(OverflowError):
122+
withself.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()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Optional big memory tests in ``test_sqlite3`` now catch the correct
2+
:exc:`sqlite.DataError` exception type in case of too large strings and/or
3+
blobs passed.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp