@@ -46,27 +46,31 @@ def test_split_when_contains_matched_and_unmatched():
4646 error1 = RuntimeError ("Runtime Error1" )
4747 error2 = ValueError ("Value Error2" )
4848 group = ExceptionGroup (
49- "Many Errors" , [error1 , error2 ], ["Runtime Error1" , "Value Error2" ]
49+ "Many Errors" ,
50+ [error1 , error2 ],
51+ ["Runtime Error1" , "Value Error2" ]
5052 )
5153 matched , unmatched = split (RuntimeError , group )
5254 assert isinstance (matched , ExceptionGroup )
5355 assert isinstance (unmatched , ExceptionGroup )
5456 assert matched .exceptions == [error1 ]
5557 assert matched .message == "Many Errors"
56- assert matched .sources == [" Runtime Error1" ]
58+ assert matched .sources == [' Runtime Error1' ]
5759 assert unmatched .exceptions == [error2 ]
5860 assert unmatched .message == "Many Errors"
59- assert unmatched .sources == [" Value Error2" ]
61+ assert unmatched .sources == [' Value Error2' ]
6062
6163
6264def test_split_with_predicate ():
6365 def _match (err ):
64- return str (err ) != " skip"
66+ return str (err ) != ' skip'
6567
6668 error1 = RuntimeError ("skip" )
6769 error2 = RuntimeError ("Runtime Error" )
6870 group = ExceptionGroup (
69- "Many Errors" , [error1 , error2 ], ["skip" , "Runtime Error" ]
71+ "Many Errors" ,
72+ [error1 , error2 ],
73+ ["skip" , "Runtime Error" ]
7074 )
7175 matched , unmatched = split (RuntimeError , group , match = _match )
7276 assert matched .exceptions == [error2 ]
0 commit comments