Skip to content

Commit b8fa7bd

Browse files
gh-105557: Remove duplicate sqlite3 test method (#105558)
test_func_return_too_large_int() was defined twice. Keep only the redefined method, as that also checks the tracebacks.
1 parent 9bf8d82 commit b8fa7bd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Lib/test/test_sqlite3/test_userfunctions.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ def setUp(self):
195195
self.con.create_function("returnblob", 0, func_returnblob)
196196
self.con.create_function("returnlonglong", 0, func_returnlonglong)
197197
self.con.create_function("returnnan", 0, lambda: float("nan"))
198-
self.con.create_function("returntoolargeint", 0, lambda: 1 << 65)
199198
self.con.create_function("return_noncont_blob", 0,
200199
lambda: memoryview(b"blob")[::2])
201200
self.con.create_function("raiseexception", 0, func_raiseexception)
@@ -294,11 +293,6 @@ def test_func_return_nan(self):
294293
cur.execute("select returnnan()")
295294
self.assertIsNone(cur.fetchone()[0])
296295

297-
def test_func_return_too_large_int(self):
298-
cur = self.con.cursor()
299-
self.assertRaisesRegex(sqlite.DataError, "string or blob too big",
300-
self.con.execute, "select returntoolargeint()")
301-
302296
@with_tracebacks(ZeroDivisionError, name="func_raiseexception")
303297
def test_func_exception(self):
304298
cur = self.con.cursor()
@@ -444,9 +438,10 @@ def md5sum(t):
444438
@with_tracebacks(OverflowError)
445439
def test_func_return_too_large_int(self):
446440
cur = self.con.cursor()
441+
msg = "string or blob too big"
447442
for value in 2**63, -2**63-1, 2**64:
448443
self.con.create_function("largeint", 0, lambda value=value: value)
449-
with self.assertRaises(sqlite.DataError):
444+
with self.assertRaisesRegex(sqlite.DataError, msg):
450445
cur.execute("select largeint()")
451446

452447
@with_tracebacks(UnicodeEncodeError, "surrogates not allowed", "chr")

0 commit comments

Comments
 (0)