Skip to content

Commit 1e655c7

Browse files
committed
Fix ty ignores
1 parent 403d98f commit 1e655c7

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

tests/integration/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async def maybe_await(value: T | Coroutine[Any, Any, T]) -> T:
9595
result = await maybe_await(client.datasets().list())
9696
"""
9797
if hasattr(value, '__await__'):
98-
return await value # type: ignore[misc,return-value]
98+
return await value # ty: ignore[invalid-await]
9999
return value
100100

101101

tests/integration/test_key_value_store.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)