@@ -2036,52 +2036,52 @@ def test_invalid_match_type_combinations(wait_pane: Pane) -> None:
2036
2036
assert "doesn't match patterns" in str (excinfo .value )
2037
2037
2038
2038
# Case 2: wait_for_any_content with invalid pattern type for CONTAINS
2039
- with pytest .raises (TypeError ) as excinfo :
2039
+ with pytest .raises (TypeError ) as excinfo_type_error :
2040
2040
wait_for_any_content (
2041
2041
wait_pane ,
2042
2042
[123 ], # type: ignore # Integer not valid for CONTAINS
2043
2043
ContentMatchType .CONTAINS ,
2044
2044
timeout = 0.5 ,
2045
2045
)
2046
- assert "must be a string" in str (excinfo .value )
2046
+ assert "must be a string" in str (excinfo_type_error .value )
2047
2047
2048
2048
# Case 3: wait_for_all_content with empty patterns list
2049
- with pytest .raises (ValueError ) as excinfo :
2049
+ with pytest .raises (ValueError ) as excinfo_empty :
2050
2050
wait_for_all_content (
2051
2051
wait_pane ,
2052
2052
[], # Empty patterns list
2053
2053
ContentMatchType .CONTAINS ,
2054
2054
timeout = 0.5 ,
2055
2055
)
2056
- assert "At least one content pattern" in str (excinfo .value )
2056
+ assert "At least one content pattern" in str (excinfo_empty .value )
2057
2057
2058
2058
# Case 4: wait_for_all_content with mismatched lengths
2059
- with pytest .raises (ValueError ) as excinfo :
2059
+ with pytest .raises (ValueError ) as excinfo_mismatch :
2060
2060
wait_for_all_content (
2061
2061
wait_pane ,
2062
2062
["pattern1" , "pattern2" ], # 2 patterns
2063
2063
[ContentMatchType .CONTAINS ], # Only 1 match type
2064
2064
timeout = 0.5 ,
2065
2065
)
2066
- assert "match_types list" in str (excinfo .value )
2067
- assert "doesn't match patterns" in str (excinfo .value )
2066
+ assert "match_types list" in str (excinfo_mismatch .value )
2067
+ assert "doesn't match patterns" in str (excinfo_mismatch .value )
2068
2068
2069
2069
# Case 5: wait_for_pane_content with wrong pattern type for PREDICATE
2070
- with pytest .raises (TypeError ) as excinfo :
2070
+ with pytest .raises (TypeError ) as excinfo_predicate :
2071
2071
wait_for_pane_content (
2072
2072
wait_pane ,
2073
2073
"not callable" , # String not valid for PREDICATE
2074
2074
ContentMatchType .PREDICATE ,
2075
2075
timeout = 0.5 ,
2076
2076
)
2077
- assert "must be callable" in str (excinfo .value )
2077
+ assert "must be callable" in str (excinfo_predicate .value )
2078
2078
2079
2079
# Case 6: Mixed match types with invalid pattern types
2080
- with pytest .raises (TypeError ) as excinfo :
2080
+ with pytest .raises (TypeError ) as excinfo_mixed :
2081
2081
wait_for_any_content (
2082
2082
wait_pane ,
2083
2083
["valid string" , re .compile (r"\d+" ), 123 ], # type: ignore
2084
2084
[ContentMatchType .CONTAINS , ContentMatchType .REGEX , ContentMatchType .EXACT ],
2085
2085
timeout = 0.5 ,
2086
2086
)
2087
- assert "Pattern at index 2" in str (excinfo .value )
2087
+ assert "Pattern at index 2" in str (excinfo_mixed .value )
0 commit comments