1515 from .conftest import ActorFactory
1616
1717
18- async def test_actor_reports_running_on_platform (make_actor : ActorFactory ) -> None :
18+ async def test_actor_reports_running_on_platform (
19+ apify_client_async : ApifyClientAsync ,
20+ make_actor : ActorFactory ,
21+ ) -> None :
1922 async def main () -> None :
2023 async with Actor :
2124 assert Actor .is_at_home () is True
2225
2326 actor = await make_actor ('is-at-home' , main_func = main )
2427
2528 run_result = await actor .call ()
26-
2729 assert run_result is not None
28- assert run_result ['status' ] == 'SUCCEEDED'
2930
31+ run_client = apify_client_async .run (run_result ['id' ])
32+ run_client_result = await run_client .wait_for_finish (wait_secs = 300 )
33+
34+ assert run_client_result is not None
35+ assert run_client_result ['status' ] == 'SUCCEEDED'
3036
31- async def test_actor_retrieves_env_vars (make_actor : ActorFactory ) -> None :
37+
38+ async def test_actor_retrieves_env_vars (
39+ apify_client_async : ApifyClientAsync ,
40+ make_actor : ActorFactory ,
41+ ) -> None :
3242 async def main () -> None :
3343 async with Actor :
3444 env_dict = Actor .get_env ()
@@ -48,12 +58,19 @@ async def main() -> None:
4858 actor = await make_actor ('get-env' , main_func = main )
4959
5060 run_result = await actor .call ()
51-
5261 assert run_result is not None
62+
63+ run_client = apify_client_async .run (run_result ['id' ])
64+ run_client_result = await run_client .wait_for_finish (wait_secs = 300 )
65+
66+ assert run_client_result is not None
5367 assert run_result ['status' ] == 'SUCCEEDED'
5468
5569
56- async def test_actor_creates_new_client_instance (make_actor : ActorFactory ) -> None :
70+ async def test_actor_creates_new_client_instance (
71+ apify_client_async : ApifyClientAsync ,
72+ make_actor : ActorFactory ,
73+ ) -> None :
5774 async def main () -> None :
5875 import os
5976
@@ -71,8 +88,12 @@ async def main() -> None:
7188 actor = await make_actor ('new-client' , main_func = main )
7289
7390 run_result = await actor .call ()
74-
7591 assert run_result is not None
92+
93+ run_client = apify_client_async .run (run_result ['id' ])
94+ run_client_result = await run_client .wait_for_finish (wait_secs = 300 )
95+
96+ assert run_client_result is not None
7697 assert run_result ['status' ] == 'SUCCEEDED'
7798
7899 output_record = await actor .last_run ().key_value_store ().get_record ('OUTPUT' )
0 commit comments