@@ -208,7 +208,7 @@ async def test_redirected_logs_async(
208
208
209
209
with caplog .at_level (logging .DEBUG , logger = logger_name ):
210
210
async with streamed_log :
211
- # Do stuff while the log from the other actor is being redirected to the logs.
211
+ # Do stuff while the log from the other Actor is being redirected to the logs.
212
212
await asyncio .sleep (2 )
213
213
214
214
assert len (caplog .records ) == expected_log_count
@@ -246,7 +246,7 @@ def test_redirected_logs_sync(
246
246
logger_name = f'apify.{ _MOCKED_ACTOR_NAME } -{ _MOCKED_RUN_ID } '
247
247
248
248
with caplog .at_level (logging .DEBUG , logger = logger_name ), streamed_log :
249
- # Do stuff while the log from the other actor is being redirected to the logs.
249
+ # Do stuff while the log from the other Actor is being redirected to the logs.
250
250
time .sleep (2 )
251
251
252
252
assert len (caplog .records ) == expected_log_count
@@ -267,10 +267,10 @@ async def test_actor_call_redirect_logs_to_default_logger_async(
267
267
Caplog contains logs before formatting, so formatting is not included in the test expectations."""
268
268
logger_name = f'apify.{ _MOCKED_ACTOR_NAME } -{ _MOCKED_RUN_ID } '
269
269
logger = logging .getLogger (logger_name )
270
- run_client = ApifyClientAsync (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
270
+ actor_client = ApifyClientAsync (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
271
271
272
272
with caplog .at_level (logging .DEBUG , logger = logger_name ):
273
- await run_client .call ()
273
+ await actor_client .call ()
274
274
275
275
# Ensure expected handler and formater
276
276
assert isinstance (logger .handlers [0 ].formatter , RedirectLogFormatter )
@@ -295,10 +295,10 @@ def test_actor_call_redirect_logs_to_default_logger_sync(
295
295
Caplog contains logs before formatting, so formatting is not included in the test expectations."""
296
296
logger_name = f'apify.{ _MOCKED_ACTOR_NAME } -{ _MOCKED_RUN_ID } '
297
297
logger = logging .getLogger (logger_name )
298
- run_client = ApifyClient (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
298
+ actor_client = ApifyClient (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
299
299
300
300
with caplog .at_level (logging .DEBUG , logger = logger_name ):
301
- run_client .call ()
301
+ actor_client .call ()
302
302
303
303
# Ensure expected handler and formater
304
304
assert isinstance (logger .handlers [0 ].formatter , RedirectLogFormatter )
@@ -318,10 +318,10 @@ async def test_actor_call_no_redirect_logs_async(
318
318
propagate_stream_logs : None , # noqa: ARG001, fixture
319
319
) -> None :
320
320
logger_name = f'apify.{ _MOCKED_ACTOR_NAME } -{ _MOCKED_RUN_ID } '
321
- run_client = ApifyClientAsync (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
321
+ actor_client = ApifyClientAsync (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
322
322
323
323
with caplog .at_level (logging .DEBUG , logger = logger_name ):
324
- await run_client .call (logger = None )
324
+ await actor_client .call (logger = None )
325
325
326
326
assert len (caplog .records ) == 0
327
327
@@ -333,10 +333,10 @@ def test_actor_call_no_redirect_logs_sync(
333
333
propagate_stream_logs : None , # noqa: ARG001, fixture
334
334
) -> None :
335
335
logger_name = f'apify.{ _MOCKED_ACTOR_NAME } -{ _MOCKED_RUN_ID } '
336
- run_client = ApifyClient (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
336
+ actor_client = ApifyClient (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
337
337
338
338
with caplog .at_level (logging .DEBUG , logger = logger_name ):
339
- run_client .call (logger = None )
339
+ actor_client .call (logger = None )
340
340
341
341
assert len (caplog .records ) == 0
342
342
@@ -351,10 +351,10 @@ async def test_actor_call_redirect_logs_to_custom_logger_async(
351
351
"""Test that logs are redirected correctly to the custom logger."""
352
352
logger_name = 'custom_logger'
353
353
logger = logging .getLogger (logger_name )
354
- run_client = ApifyClientAsync (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
354
+ actor_client = ApifyClientAsync (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
355
355
356
356
with caplog .at_level (logging .DEBUG , logger = logger_name ):
357
- await run_client .call (logger = logger )
357
+ await actor_client .call (logger = logger )
358
358
359
359
assert len (caplog .records ) == len (_EXPECTED_MESSAGES_AND_LEVELS_WITH_STATUS_MESSAGES )
360
360
for expected_message_and_level , record in zip (_EXPECTED_MESSAGES_AND_LEVELS_WITH_STATUS_MESSAGES , caplog .records ):
@@ -372,10 +372,10 @@ def test_actor_call_redirect_logs_to_custom_logger_sync(
372
372
"""Test that logs are redirected correctly to the custom logger."""
373
373
logger_name = 'custom_logger'
374
374
logger = logging .getLogger (logger_name )
375
- run_client = ApifyClient (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
375
+ actor_client = ApifyClient (token = 'mocked_token' , api_url = _MOCKED_API_URL ).actor (actor_id = _MOCKED_ACTOR_ID )
376
376
377
377
with caplog .at_level (logging .DEBUG , logger = logger_name ):
378
- run_client .call (logger = logger )
378
+ actor_client .call (logger = logger )
379
379
380
380
assert len (caplog .records ) == len (_EXPECTED_MESSAGES_AND_LEVELS_WITH_STATUS_MESSAGES )
381
381
for expected_message_and_level , record in zip (_EXPECTED_MESSAGES_AND_LEVELS_WITH_STATUS_MESSAGES , caplog .records ):
@@ -400,7 +400,7 @@ async def test_redirect_status_message_async(
400
400
status_message_redirector = await run_client .get_status_message_redirector (check_period = timedelta (seconds = 0 ))
401
401
with caplog .at_level (logging .DEBUG , logger = logger_name ):
402
402
async with status_message_redirector :
403
- # Do stuff while the status from the other actor is being redirected to the logs.
403
+ # Do stuff while the status from the other Actor is being redirected to the logs.
404
404
await asyncio .sleep (3 )
405
405
406
406
assert caplog .records [0 ].message == 'Status: RUNNING, Message: Initial message'
@@ -424,7 +424,7 @@ def test_redirect_status_message_sync(
424
424
425
425
status_message_redirector = run_client .get_status_message_redirector (check_period = timedelta (seconds = 0 ))
426
426
with caplog .at_level (logging .DEBUG , logger = logger_name ), status_message_redirector :
427
- # Do stuff while the status from the other actor is being redirected to the logs.
427
+ # Do stuff while the status from the other Actor is being redirected to the logs.
428
428
time .sleep (3 )
429
429
430
430
assert caplog .records [0 ].message == 'Status: RUNNING, Message: Initial message'
0 commit comments