@@ -24,7 +24,7 @@ def test_split_when_all_exception_matched():
2424 group = ExceptionGroup (
2525 "Many Errors" ,
2626 [RuntimeError ("Runtime Error1" ), RuntimeError ("Runtime Error2" )],
27- ["Runtime Error1" , "Runtime Error2" ]
27+ ["Runtime Error1" , "Runtime Error2" ],
2828 )
2929 matched , unmatched = split (RuntimeError , group )
3030 assert matched is group
@@ -35,7 +35,7 @@ def test_split_when_all_exception_unmatched():
3535 group = ExceptionGroup (
3636 "Many Errors" ,
3737 [RuntimeError ("Runtime Error1" ), RuntimeError ("Runtime Error2" )],
38- ["Runtime Error1" , "Runtime Error2" ]
38+ ["Runtime Error1" , "Runtime Error2" ],
3939 )
4040 matched , unmatched = split (ValueError , group )
4141 assert matched is None
@@ -46,31 +46,27 @@ def test_split_when_contains_matched_and_unmatched():
4646 error1 = RuntimeError ("Runtime Error1" )
4747 error2 = ValueError ("Value Error2" )
4848 group = ExceptionGroup (
49- "Many Errors" ,
50- [error1 , error2 ],
51- ['Runtime Error1' , 'Value Error2' ]
49+ "Many Errors" , [error1 , error2 ], ["Runtime Error1" , "Value Error2" ]
5250 )
5351 matched , unmatched = split (RuntimeError , group )
5452 assert isinstance (matched , ExceptionGroup )
5553 assert isinstance (unmatched , ExceptionGroup )
5654 assert matched .exceptions == [error1 ]
5755 assert matched .message == "Many Errors"
58- assert matched .sources == [' Runtime Error1' ]
56+ assert matched .sources == [" Runtime Error1" ]
5957 assert unmatched .exceptions == [error2 ]
6058 assert unmatched .message == "Many Errors"
61- assert unmatched .sources == [' Value Error2' ]
59+ assert unmatched .sources == [" Value Error2" ]
6260
6361
6462def test_split_with_predicate ():
6563 def _match (err ):
66- return str (err ) != ' skip'
64+ return str (err ) != " skip"
6765
6866 error1 = RuntimeError ("skip" )
6967 error2 = RuntimeError ("Runtime Error" )
7068 group = ExceptionGroup (
71- "Many Errors" ,
72- [error1 , error2 ],
73- ['skip' , 'Runtime Error' ]
69+ "Many Errors" , [error1 , error2 ], ["skip" , "Runtime Error" ]
7470 )
7571 matched , unmatched = split (RuntimeError , group , match = _match )
7672 assert matched .exceptions == [error2 ]
0 commit comments