@@ -6985,7 +6985,7 @@ def fetch_comp_code(dask_scheduler):
69856985 assert len (computations ) == 1
69866986 comp = computations [0 ]
69876987 assert len (comp .code ) == 1
6988- return comp .code [ 0 ]
6988+ return first ( comp .code )
69896989
69906990 code = client .run_on_scheduler (fetch_comp_code )
69916991
@@ -7005,7 +7005,7 @@ def fetch_comp_code(dask_scheduler):
70057005 assert len (computations ) == 1
70067006 comp = computations [0 ]
70077007 assert len (comp .code ) == 1
7008- return comp .code [ 0 ]
7008+ return first ( comp .code )
70097009
70107010 code = client .run_on_scheduler (fetch_comp_code )
70117011 assert code == "<Code not available>"
@@ -7026,7 +7026,7 @@ async def test_computation_object_code_dask_persist(c, s, a, b):
70267026 comp = computations [0 ]
70277027 assert len (comp .code ) == 1
70287028
7029- assert comp .code [ 0 ] == test_function_code
7029+ assert first ( comp .code ) == test_function_code
70307030
70317031
70327032@gen_cluster (client = True )
@@ -7047,7 +7047,7 @@ def func(x):
70477047
70487048 assert len (comp .code ) == 1
70497049
7050- assert comp .code [ 0 ] == test_function_code
7050+ assert first ( comp .code ) == test_function_code
70517051
70527052
70537053@gen_cluster (client = True )
@@ -7069,7 +7069,7 @@ def func(x):
70697069 # Code is deduplicated
70707070 assert len (comp .code ) == 1
70717071
7072- assert comp .code [ 0 ] == test_function_code
7072+ assert first ( comp .code ) == test_function_code
70737073
70747074
70757075@gen_cluster (client = True )
@@ -7091,7 +7091,7 @@ def func(x):
70917091 # Code is deduplicated
70927092 assert len (comp .code ) == 1
70937093
7094- assert comp .code [ 0 ] == test_function_code
7094+ assert first ( comp .code ) == test_function_code
70957095
70967096
70977097@gen_cluster (client = True )
@@ -7109,7 +7109,7 @@ async def test_computation_object_code_client_map(c, s, a, b):
71097109 comp = computations [0 ]
71107110 assert len (comp .code ) == 1
71117111
7112- assert comp .code [ 0 ] == test_function_code
7112+ assert first ( comp .code ) == test_function_code
71137113
71147114
71157115@gen_cluster (client = True )
@@ -7127,7 +7127,7 @@ async def test_computation_object_code_client_compute(c, s, a, b):
71277127 comp = computations [0 ]
71287128 assert len (comp .code ) == 1
71297129
7130- assert comp .code [ 0 ] == test_function_code
7130+ assert first ( comp .code ) == test_function_code
71317131
71327132
71337133@gen_cluster (client = True , Worker = Nanny )
0 commit comments