Skip to content

Commit 6599087

Browse files
author
Val Brodsky
committed
Remove more sources of data leakage
1 parent 551c1ef commit 6599087

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

tests/integration/annotation_import/test_data_types.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ def create_data_row_for_project(project, dataset, data_row_ndjson, batch_name):
137137
])
138138
def 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

tests/integration/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ def initial_dataset(client, rand_gen):
390390
dataset = client.create_dataset(name=rand_gen(str))
391391
yield dataset
392392

393+
dataset.delete()
394+
393395

394396
@pytest.fixture
395397
def project_with_ontology(project):

0 commit comments

Comments
 (0)