@@ -254,22 +254,22 @@ def test_func_return_nan(self):
254
254
cur .execute ("select returnnan()" )
255
255
self .assertIsNone (cur .fetchone ()[0 ])
256
256
257
- @with_tracebacks (ZeroDivisionError , name = "func_raiseexception" )
257
+ @with_tracebacks (ZeroDivisionError , msg_regex = "func_raiseexception" )
258
258
def test_func_exception (self ):
259
259
cur = self .con .cursor ()
260
260
with self .assertRaises (sqlite .OperationalError ) as cm :
261
261
cur .execute ("select raiseexception()" )
262
262
cur .fetchone ()
263
263
self .assertEqual (str (cm .exception ), 'user-defined function raised exception' )
264
264
265
- @with_tracebacks (MemoryError , name = "func_memoryerror" )
265
+ @with_tracebacks (MemoryError , msg_regex = "func_memoryerror" )
266
266
def test_func_memory_error (self ):
267
267
cur = self .con .cursor ()
268
268
with self .assertRaises (MemoryError ):
269
269
cur .execute ("select memoryerror()" )
270
270
cur .fetchone ()
271
271
272
- @with_tracebacks (OverflowError , name = "func_overflowerror" )
272
+ @with_tracebacks (OverflowError , msg_regex = "func_overflowerror" )
273
273
def test_func_overflow_error (self ):
274
274
cur = self .con .cursor ()
275
275
with self .assertRaises (sqlite .DataError ):
@@ -389,7 +389,7 @@ def test_func_return_too_large_int(self):
389
389
with self .assertRaisesRegex (sqlite .DataError , msg ):
390
390
cur .execute ("select largeint()" )
391
391
392
- @with_tracebacks (UnicodeEncodeError , "surrogates not allowed" , "chr" )
392
+ @with_tracebacks (UnicodeEncodeError , "surrogates not allowed" )
393
393
def test_func_return_text_with_surrogates (self ):
394
394
cur = self .con .cursor ()
395
395
self .con .create_function ("pychr" , 1 , chr )
@@ -641,7 +641,7 @@ def test_aggr_error_on_create(self):
641
641
with self .assertRaises (sqlite .OperationalError ):
642
642
self .con .create_function ("bla" , - 100 , AggrSum )
643
643
644
- @with_tracebacks (AttributeError , name = "AggrNoStep" )
644
+ @with_tracebacks (AttributeError , msg_regex = "AggrNoStep" )
645
645
def test_aggr_no_step (self ):
646
646
cur = self .con .cursor ()
647
647
with self .assertRaises (sqlite .OperationalError ) as cm :
@@ -656,23 +656,23 @@ def test_aggr_no_finalize(self):
656
656
cur .execute ("select nofinalize(t) from test" )
657
657
val = cur .fetchone ()[0 ]
658
658
659
- @with_tracebacks (ZeroDivisionError , name = "AggrExceptionInInit" )
659
+ @with_tracebacks (ZeroDivisionError , msg_regex = "AggrExceptionInInit" )
660
660
def test_aggr_exception_in_init (self ):
661
661
cur = self .con .cursor ()
662
662
with self .assertRaises (sqlite .OperationalError ) as cm :
663
663
cur .execute ("select excInit(t) from test" )
664
664
val = cur .fetchone ()[0 ]
665
665
self .assertEqual (str (cm .exception ), "user-defined aggregate's '__init__' method raised error" )
666
666
667
- @with_tracebacks (ZeroDivisionError , name = "AggrExceptionInStep" )
667
+ @with_tracebacks (ZeroDivisionError , msg_regex = "AggrExceptionInStep" )
668
668
def test_aggr_exception_in_step (self ):
669
669
cur = self .con .cursor ()
670
670
with self .assertRaises (sqlite .OperationalError ) as cm :
671
671
cur .execute ("select excStep(t) from test" )
672
672
val = cur .fetchone ()[0 ]
673
673
self .assertEqual (str (cm .exception ), "user-defined aggregate's 'step' method raised error" )
674
674
675
- @with_tracebacks (ZeroDivisionError , name = "AggrExceptionInFinalize" )
675
+ @with_tracebacks (ZeroDivisionError , msg_regex = "AggrExceptionInFinalize" )
676
676
def test_aggr_exception_in_finalize (self ):
677
677
cur = self .con .cursor ()
678
678
with self .assertRaises (sqlite .OperationalError ) as cm :
@@ -822,11 +822,11 @@ def authorizer_cb(action, arg1, arg2, dbname, source):
822
822
raise ValueError
823
823
return sqlite .SQLITE_OK
824
824
825
- @with_tracebacks (ValueError , name = "authorizer_cb" )
825
+ @with_tracebacks (ValueError , msg_regex = "authorizer_cb" )
826
826
def test_table_access (self ):
827
827
super ().test_table_access ()
828
828
829
- @with_tracebacks (ValueError , name = "authorizer_cb" )
829
+ @with_tracebacks (ValueError , msg_regex = "authorizer_cb" )
830
830
def test_column_access (self ):
831
831
super ().test_table_access ()
832
832
0 commit comments