@@ -195,7 +195,6 @@ def setUp(self):
195
195
self .con .create_function ("returnblob" , 0 , func_returnblob )
196
196
self .con .create_function ("returnlonglong" , 0 , func_returnlonglong )
197
197
self .con .create_function ("returnnan" , 0 , lambda : float ("nan" ))
198
- self .con .create_function ("returntoolargeint" , 0 , lambda : 1 << 65 )
199
198
self .con .create_function ("return_noncont_blob" , 0 ,
200
199
lambda : memoryview (b"blob" )[::2 ])
201
200
self .con .create_function ("raiseexception" , 0 , func_raiseexception )
@@ -294,11 +293,6 @@ def test_func_return_nan(self):
294
293
cur .execute ("select returnnan()" )
295
294
self .assertIsNone (cur .fetchone ()[0 ])
296
295
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
-
302
296
@with_tracebacks (ZeroDivisionError , name = "func_raiseexception" )
303
297
def test_func_exception (self ):
304
298
cur = self .con .cursor ()
@@ -444,9 +438,10 @@ def md5sum(t):
444
438
@with_tracebacks (OverflowError )
445
439
def test_func_return_too_large_int (self ):
446
440
cur = self .con .cursor ()
441
+ msg = "string or blob too big"
447
442
for value in 2 ** 63 , - 2 ** 63 - 1 , 2 ** 64 :
448
443
self .con .create_function ("largeint" , 0 , lambda value = value : value )
449
- with self .assertRaises (sqlite .DataError ):
444
+ with self .assertRaisesRegex (sqlite .DataError , msg ):
450
445
cur .execute ("select largeint()" )
451
446
452
447
@with_tracebacks (UnicodeEncodeError , "surrogates not allowed" , "chr" )
0 commit comments