File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,13 +18,20 @@ class TestRunCollectionSync:
1818
1919 def setup_runs (self , apify_client : ApifyClient ) -> None :
2020 self .created_runs = []
21- self .created_runs .append (apify_client .actor (self .APIFY_HELLO_WORLD_ACTOR ).call ())
2221
23- self .created_runs .append (apify_client .actor (self .APIFY_HELLO_WORLD_ACTOR ).call (timeout_secs = 1 ))
22+ successfull_run = apify_client .actor (self .APIFY_HELLO_WORLD_ACTOR ).call ()
23+ if successfull_run is not None :
24+ self .created_runs .append (successfull_run )
25+
26+ timed_out_run = apify_client .actor (self .APIFY_HELLO_WORLD_ACTOR ).call (timeout_secs = 1 )
27+ if timed_out_run is not None :
28+ self .created_runs .append (timed_out_run )
2429
2530 def teadown_runs (self , apify_client : ApifyClient ) -> None :
2631 for run in self .created_runs :
27- apify_client .run (run .get ('id' )).delete ()
32+ run_id = run .get ('id' )
33+ if isinstance (run_id , str ):
34+ apify_client .run (run_id ).delete ()
2835
2936 async def test_run_collection_list_multiple_statuses (self , apify_client : ApifyClient ) -> None :
3037 self .setup_runs (apify_client )
You can’t perform that action at this time.
0 commit comments