@@ -46,27 +46,31 @@ def test_split_when_contains_matched_and_unmatched():
46
46
error1 = RuntimeError ("Runtime Error1" )
47
47
error2 = ValueError ("Value Error2" )
48
48
group = ExceptionGroup (
49
- "Many Errors" , [error1 , error2 ], ["Runtime Error1" , "Value Error2" ]
49
+ "Many Errors" ,
50
+ [error1 , error2 ],
51
+ ["Runtime Error1" , "Value Error2" ]
50
52
)
51
53
matched , unmatched = split (RuntimeError , group )
52
54
assert isinstance (matched , ExceptionGroup )
53
55
assert isinstance (unmatched , ExceptionGroup )
54
56
assert matched .exceptions == [error1 ]
55
57
assert matched .message == "Many Errors"
56
- assert matched .sources == [" Runtime Error1" ]
58
+ assert matched .sources == [' Runtime Error1' ]
57
59
assert unmatched .exceptions == [error2 ]
58
60
assert unmatched .message == "Many Errors"
59
- assert unmatched .sources == [" Value Error2" ]
61
+ assert unmatched .sources == [' Value Error2' ]
60
62
61
63
62
64
def test_split_with_predicate ():
63
65
def _match (err ):
64
- return str (err ) != " skip"
66
+ return str (err ) != ' skip'
65
67
66
68
error1 = RuntimeError ("skip" )
67
69
error2 = RuntimeError ("Runtime Error" )
68
70
group = ExceptionGroup (
69
- "Many Errors" , [error1 , error2 ], ["skip" , "Runtime Error" ]
71
+ "Many Errors" ,
72
+ [error1 , error2 ],
73
+ ["skip" , "Runtime Error" ]
70
74
)
71
75
matched , unmatched = split (RuntimeError , group , match = _match )
72
76
assert matched .exceptions == [error2 ]
0 commit comments