@@ -186,27 +186,34 @@ async def test_stream_record_signature(
186186 # We'll test the error condition separately based on client type
187187 try :
188188 if is_async :
189- async with kvs .stream_record (key = key ) as stream : # type : ignore[union-attr ]
189+ async with kvs .stream_record (key = key ) as stream : # ty : ignore[invalid-context-manager ]
190190 pass
191191 pytest .fail ('Expected ApifyApiError' )
192192 else :
193- with kvs .stream_record (key = key ) as stream : # type : ignore[union-attr ]
193+ with kvs .stream_record (key = key ) as stream : # ty : ignore[invalid-context-manager ]
194194 pass
195195 pytest .fail ('Expected ApifyApiError' )
196196 except ApifyApiError :
197197 pass # Expected
198198
199199 # Kvs content retrieved with correct signature
200200 if is_async :
201- async with kvs .stream_record (key = key , signature = test_kvs_of_another_user .keys_signature [key ]) as stream : # type: ignore[union-attr]
201+ async with kvs .stream_record (
202+ key = key ,
203+ signature = test_kvs_of_another_user .keys_signature [key ],
204+ ) as stream : # ty: ignore[invalid-context-manager]
202205 assert stream
203206 stream_dict = cast ('dict' , stream )
204207 value = json .loads (stream_dict ['value' ].content .decode ('utf-8' ))
205208 else :
206- with kvs .stream_record (key = key , signature = test_kvs_of_another_user .keys_signature [key ]) as stream : # type: ignore[union-attr]
209+ with kvs .stream_record (
210+ key = key ,
211+ signature = test_kvs_of_another_user .keys_signature [key ],
212+ ) as stream : # ty: ignore[invalid-context-manager]
207213 assert stream
208214 stream_dict = cast ('dict' , stream )
209215 value = json .loads (stream_dict ['value' ].content .decode ('utf-8' ))
216+
210217 assert test_kvs_of_another_user .expected_content [key ] == value
211218
212219
0 commit comments