@@ -26,7 +26,7 @@ def test_status_code_from_int_invalid(self):
2626 str (ctx .exception ), 'code_int=9876 is not a valid absl::StatusCode' )
2727
2828 def test_status_code_as_int (self ):
29- self .assertEqual (status .StatusCodeAsInt (status .StatusCode .UNAVAILABLE ), 14 )
29+ self .assertEqual (status .StatusCodeAsInt (status .StatusCode .UNAVAILABLE ), 14 ) # pyrefly: ignore[bad-argument-type]
3030
3131 def test_repr (self ):
3232 self .assertEqual (
@@ -180,24 +180,24 @@ def test_init_from_serialized_exception_unexpected_len_state(self):
180180 with self .assertRaisesRegex (
181181 ValueError , r'Unexpected len\(state\) == 4'
182182 r' \[.*register_status_bindings\.cc:[0-9]+\]' ):
183- status .Status (status .InitFromTag .serialized , (0 , 0 , 0 , 0 ))
183+ status .Status (status .InitFromTag .serialized , (0 , 0 , 0 , 0 )) # pyrefly: ignore[no-matching-overload]
184184
185185 def test_init_from_serialized_exception_unexpected_len_ap_item_tup (self ):
186186 with self .assertRaisesRegex (
187187 ValueError ,
188188 r'Unexpected len\(tuple\) == 3 where \(type_url, payload\) is expected'
189189 r' \[.*register_status_bindings\.cc:[0-9]+\]' ):
190- status .Status (status .InitFromTag .serialized ,
190+ status .Status (status .InitFromTag .serialized , # pyrefly: ignore[no-matching-overload]
191191 (status .StatusCode .CANCELLED , '' , ((0 , 0 , 0 ),)))
192192
193193 def test_init_from_capsule_direct_ok (self ):
194194 orig = status .Status (status .StatusCode .CANCELLED , 'Direct.' )
195- from_cap = status .Status (status .InitFromTag .capsule , orig .as_absl_Status ())
195+ from_cap = status .Status (status .InitFromTag .capsule , orig .as_absl_Status ()) # pyrefly: ignore[no-matching-overload]
196196 self .assertEqual (from_cap , orig )
197197
198198 def test_init_from_capsule_as_capsule_method_ok (self ):
199199 orig = status .Status (status .StatusCode .CANCELLED , 'AsCapsuleMethod.' )
200- from_cap = status .Status (status .InitFromTag .capsule , orig )
200+ from_cap = status .Status (status .InitFromTag .capsule , orig ) # pyrefly: ignore[no-matching-overload]
201201 self .assertEqual (from_cap , orig )
202202
203203 @parameterized .parameters (None , '' , 0 )
@@ -220,7 +220,7 @@ def test_init_from_capsule_direct_not_a_capsule(self, not_a_capsule):
220220 @parameterized .parameters (None , '' , 0 )
221221 def test_init_from_capsule_correct_method_not_a_capsule (self , not_a_capsule ):
222222 with self .assertRaises (ValueError ) as ctx :
223- status .Status (status .InitFromTag .capsule , NotACapsule (not_a_capsule ))
223+ status .Status (status .InitFromTag .capsule , NotACapsule (not_a_capsule )) # pyrefly: ignore[no-matching-overload]
224224 nm = not_a_capsule .__class__ .__name__
225225 self .assertEqual (
226226 str (ctx .exception ),
@@ -231,7 +231,7 @@ def test_init_from_capsule_correct_method_not_a_capsule(self, not_a_capsule):
231231class StatusNotOkTest (absltest .TestCase ):
232232
233233 def test_build_status_not_ok_enum (self ):
234- e = status .BuildStatusNotOk (status .StatusCode .INVALID_ARGUMENT , 'Msg enum.' )
234+ e = status .BuildStatusNotOk (status .StatusCode .INVALID_ARGUMENT , 'Msg enum.' ) # pyrefly: ignore[bad-argument-type]
235235 self .assertEqual (e .status .code (), status .StatusCode .INVALID_ARGUMENT )
236236 self .assertEqual (e .code , int (status .StatusCode .INVALID_ARGUMENT ))
237237 self .assertEqual (e .message , 'Msg enum.' )
@@ -242,17 +242,17 @@ def test_build_status_not_ok_int(self):
242242 self .assertIn ('incompatible function arguments' , str (cm .exception ))
243243
244244 def test_eq (self ):
245- sa1 = status .BuildStatusNotOk (status .StatusCode .UNKNOWN , 'sa' )
246- sa2 = status .BuildStatusNotOk (status .StatusCode .UNKNOWN , 'sa' )
247- sb = status .BuildStatusNotOk (status .StatusCode .UNKNOWN , 'sb' )
245+ sa1 = status .BuildStatusNotOk (status .StatusCode .UNKNOWN , 'sa' ) # pyrefly: ignore[bad-argument-type]
246+ sa2 = status .BuildStatusNotOk (status .StatusCode .UNKNOWN , 'sa' ) # pyrefly: ignore[bad-argument-type]
247+ sb = status .BuildStatusNotOk (status .StatusCode .UNKNOWN , 'sb' ) # pyrefly: ignore[bad-argument-type]
248248 self .assertTrue (bool (sa1 == sa1 )) # pylint: disable=comparison-with-itself
249249 self .assertTrue (bool (sa1 == sa2 ))
250250 self .assertFalse (bool (sa1 == sb ))
251251 self .assertFalse (bool (sa1 == 'x' ))
252252 self .assertFalse (bool ('x' == sa1 ))
253253
254254 def test_pickle (self ):
255- orig = status .BuildStatusNotOk (status .StatusCode .UNKNOWN , 'Cabbage' )
255+ orig = status .BuildStatusNotOk (status .StatusCode .UNKNOWN , 'Cabbage' ) # pyrefly: ignore[bad-argument-type]
256256 ser = pickle .dumps (orig )
257257 deser = pickle .loads (ser )
258258 self .assertEqual (deser .message , 'Cabbage' )
0 commit comments