@@ -137,7 +137,8 @@ def create_data_row_for_project(project, dataset, data_row_ndjson, batch_name):
137137])
138138def test_import_data_types (client , configured_project , initial_dataset ,
139139 rand_gen , data_row_json_by_data_type ,
140- annotations_by_data_type , data_type_class ):
140+ annotations_by_data_type , data_type_class ,
141+ one_datarow ):
141142
142143 project = configured_project
143144 project_id = project .uid
@@ -304,14 +305,22 @@ def test_import_label_annotations(client, configured_project_with_one_data_row,
304305
305306
306307@pytest .mark .parametrize ('data_type, data_class, annotations' , test_params )
307- def test_import_mal_annotations (client , configured_project_with_one_data_row ,
308- data_row_json_by_data_type , data_type ,
309- data_class , annotations , rand_gen ):
310-
308+ @pytest .fixture
309+ def one_datarow (client , rand_gen , data_row_json_by_data_type , data_type ):
311310 dataset = client .create_dataset (name = rand_gen (str ))
312311 data_row_json = data_row_json_by_data_type [data_type ]
313312 data_row = dataset .create_data_row (data_row_json )
314313
314+ yield data_row
315+
316+ dataset .delete ()
317+
318+
319+ @pytest .mark .parametrize ('data_type, data_class, annotations' , test_params )
320+ def test_import_mal_annotations (client , configured_project_with_one_data_row ,
321+ data_type , data_class , annotations , rand_gen ,
322+ one_datarow ):
323+ data_row = one_datarow
315324 set_project_media_type_from_data_type (configured_project_with_one_data_row ,
316325 data_class )
317326
0 commit comments