@@ -254,22 +254,22 @@ def test_func_return_nan(self):
254254 cur .execute ("select returnnan()" )
255255 self .assertIsNone (cur .fetchone ()[0 ])
256256
257- @with_tracebacks (ZeroDivisionError , name = "func_raiseexception" )
257+ @with_tracebacks (ZeroDivisionError , msg_regex = "func_raiseexception" )
258258 def test_func_exception (self ):
259259 cur = self .con .cursor ()
260260 with self .assertRaises (sqlite .OperationalError ) as cm :
261261 cur .execute ("select raiseexception()" )
262262 cur .fetchone ()
263263 self .assertEqual (str (cm .exception ), 'user-defined function raised exception' )
264264
265- @with_tracebacks (MemoryError , name = "func_memoryerror" )
265+ @with_tracebacks (MemoryError , msg_regex = "func_memoryerror" )
266266 def test_func_memory_error (self ):
267267 cur = self .con .cursor ()
268268 with self .assertRaises (MemoryError ):
269269 cur .execute ("select memoryerror()" )
270270 cur .fetchone ()
271271
272- @with_tracebacks (OverflowError , name = "func_overflowerror" )
272+ @with_tracebacks (OverflowError , msg_regex = "func_overflowerror" )
273273 def test_func_overflow_error (self ):
274274 cur = self .con .cursor ()
275275 with self .assertRaises (sqlite .DataError ):
@@ -389,7 +389,7 @@ def test_func_return_too_large_int(self):
389389 with self .assertRaisesRegex (sqlite .DataError , msg ):
390390 cur .execute ("select largeint()" )
391391
392- @with_tracebacks (UnicodeEncodeError , "surrogates not allowed" , "chr" )
392+ @with_tracebacks (UnicodeEncodeError , "surrogates not allowed" )
393393 def test_func_return_text_with_surrogates (self ):
394394 cur = self .con .cursor ()
395395 self .con .create_function ("pychr" , 1 , chr )
@@ -641,7 +641,7 @@ def test_aggr_error_on_create(self):
641641 with self .assertRaises (sqlite .OperationalError ):
642642 self .con .create_function ("bla" , - 100 , AggrSum )
643643
644- @with_tracebacks (AttributeError , name = "AggrNoStep" )
644+ @with_tracebacks (AttributeError , msg_regex = "AggrNoStep" )
645645 def test_aggr_no_step (self ):
646646 cur = self .con .cursor ()
647647 with self .assertRaises (sqlite .OperationalError ) as cm :
@@ -656,23 +656,23 @@ def test_aggr_no_finalize(self):
656656 cur .execute ("select nofinalize(t) from test" )
657657 val = cur .fetchone ()[0 ]
658658
659- @with_tracebacks (ZeroDivisionError , name = "AggrExceptionInInit" )
659+ @with_tracebacks (ZeroDivisionError , msg_regex = "AggrExceptionInInit" )
660660 def test_aggr_exception_in_init (self ):
661661 cur = self .con .cursor ()
662662 with self .assertRaises (sqlite .OperationalError ) as cm :
663663 cur .execute ("select excInit(t) from test" )
664664 val = cur .fetchone ()[0 ]
665665 self .assertEqual (str (cm .exception ), "user-defined aggregate's '__init__' method raised error" )
666666
667- @with_tracebacks (ZeroDivisionError , name = "AggrExceptionInStep" )
667+ @with_tracebacks (ZeroDivisionError , msg_regex = "AggrExceptionInStep" )
668668 def test_aggr_exception_in_step (self ):
669669 cur = self .con .cursor ()
670670 with self .assertRaises (sqlite .OperationalError ) as cm :
671671 cur .execute ("select excStep(t) from test" )
672672 val = cur .fetchone ()[0 ]
673673 self .assertEqual (str (cm .exception ), "user-defined aggregate's 'step' method raised error" )
674674
675- @with_tracebacks (ZeroDivisionError , name = "AggrExceptionInFinalize" )
675+ @with_tracebacks (ZeroDivisionError , msg_regex = "AggrExceptionInFinalize" )
676676 def test_aggr_exception_in_finalize (self ):
677677 cur = self .con .cursor ()
678678 with self .assertRaises (sqlite .OperationalError ) as cm :
@@ -822,11 +822,11 @@ def authorizer_cb(action, arg1, arg2, dbname, source):
822822 raise ValueError
823823 return sqlite .SQLITE_OK
824824
825- @with_tracebacks (ValueError , name = "authorizer_cb" )
825+ @with_tracebacks (ValueError , msg_regex = "authorizer_cb" )
826826 def test_table_access (self ):
827827 super ().test_table_access ()
828828
829- @with_tracebacks (ValueError , name = "authorizer_cb" )
829+ @with_tracebacks (ValueError , msg_regex = "authorizer_cb" )
830830 def test_column_access (self ):
831831 super ().test_table_access ()
832832
0 commit comments