11import collections .abc
22import types
33import unittest
4- from test .support import get_c_recursion_limit
4+ from test .support import skip_emscripten_stack_overflow , skip_wasi_stack_overflow , exceeds_recursion_limit
55
66class TestExceptionGroupTypeHierarchy (unittest .TestCase ):
77 def test_exception_group_types (self ):
8- self .assertTrue ( issubclass ( ExceptionGroup , Exception ) )
9- self .assertTrue ( issubclass ( ExceptionGroup , BaseExceptionGroup ) )
10- self .assertTrue ( issubclass ( BaseExceptionGroup , BaseException ) )
8+ self .assertIsSubclass ( ExceptionGroup , Exception )
9+ self .assertIsSubclass ( ExceptionGroup , BaseExceptionGroup )
10+ self .assertIsSubclass ( BaseExceptionGroup , BaseException )
1111
1212 def test_exception_is_not_generic_type (self ):
1313 with self .assertRaisesRegex (TypeError , 'Exception' ):
@@ -20,8 +20,7 @@ def test_exception_group_is_generic_type(self):
2020
2121
2222class BadConstructorArgs (unittest .TestCase ):
23- # TODO: RUSTPYTHON
24- @unittest .expectedFailure
23+ @unittest .expectedFailure # TODO: RUSTPYTHON
2524 def test_bad_EG_construction__too_many_args (self ):
2625 MSG = r'BaseExceptionGroup.__new__\(\) takes exactly 2 arguments'
2726 with self .assertRaisesRegex (TypeError , MSG ):
@@ -462,15 +461,21 @@ def test_basics_split_by_predicate__match(self):
462461class DeepRecursionInSplitAndSubgroup (unittest .TestCase ):
463462 def make_deep_eg (self ):
464463 e = TypeError (1 )
465- for i in range (get_c_recursion_limit () + 1 ):
464+ for i in range (exceeds_recursion_limit () ):
466465 e = ExceptionGroup ('eg' , [e ])
467466 return e
468467
468+ @unittest .skip ("TODO: RUSTPYTHON; Segfault" )
469+ @skip_emscripten_stack_overflow ()
470+ @skip_wasi_stack_overflow ()
469471 def test_deep_split (self ):
470472 e = self .make_deep_eg ()
471473 with self .assertRaises (RecursionError ):
472474 e .split (TypeError )
473475
476+ @unittest .skip ("TODO: RUSTPYTHON; Segfault" )
477+ @skip_emscripten_stack_overflow ()
478+ @skip_wasi_stack_overflow ()
474479 def test_deep_subgroup (self ):
475480 e = self .make_deep_eg ()
476481 with self .assertRaises (RecursionError ):
@@ -812,8 +817,8 @@ def test_split_does_not_copy_non_sequence_notes(self):
812817 eg = ExceptionGroup ("eg" , [ValueError (1 ), TypeError (2 )])
813818 eg .__notes__ = 123
814819 match , rest = eg .split (TypeError )
815- self .assertFalse ( hasattr ( match , '__notes__' ) )
816- self .assertFalse ( hasattr ( rest , '__notes__' ) )
820+ self .assertNotHasAttr ( match , '__notes__' )
821+ self .assertNotHasAttr ( rest , '__notes__' )
817822
818823 def test_drive_invalid_return_value (self ):
819824 class MyEg (ExceptionGroup ):
0 commit comments