Skip to content

Commit a98044c

Browse files
author
Val Brodsky
committed
More fixes
1 parent d909166 commit a98044c

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

libs/labelbox/tests/conftest.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,14 +1044,11 @@ def project_with_empty_ontology(project):
10441044

10451045

10461046
@pytest.fixture
1047-
def configured_project_with_complex_ontology(
1048-
client, initial_dataset, rand_gen, image_url
1049-
):
1050-
project = client.create_project(
1051-
name=rand_gen(str),
1052-
queue_mode=QueueMode.Batch,
1053-
media_type=MediaType.Image,
1054-
)
1047+
def configured_project_with_complex_ontology(client, initial_dataset, rand_gen,
1048+
image_url, teardown_helpers):
1049+
project = client.create_project(name=rand_gen(str),
1050+
queue_mode=QueueMode.Batch,
1051+
media_type=MediaType.Image)
10551052
dataset = initial_dataset
10561053
data_row = dataset.create_data_row(row_data=image_url)
10571054
data_row_ids = [data_row.uid]
@@ -1110,7 +1107,7 @@ def configured_project_with_complex_ontology(
11101107
project.setup(editor, ontology.asdict())
11111108

11121109
yield [project, data_row]
1113-
project.delete()
1110+
teardown_helpers.teardown_project_labels_ontology_feature_schemas(project)
11141111

11151112

11161113
@pytest.fixture
@@ -1129,13 +1126,13 @@ def valid_model_id():
11291126

11301127

11311128
@pytest.fixture
1132-
def requested_labeling_service(
1133-
rand_gen,
1134-
live_chat_evaluation_project_with_new_dataset,
1135-
chat_evaluation_ontology,
1136-
model_config,
1137-
):
1138-
project = live_chat_evaluation_project_with_new_dataset
1129+
def requested_labeling_service(rand_gen, client, chat_evaluation_ontology,
1130+
model_config, teardown_helpers):
1131+
project_name = f"test-model-evaluation-project-{rand_gen(str)}"
1132+
dataset_name = f"test-model-evaluation-dataset-{rand_gen(str)}"
1133+
project = client.create_model_evaluation_project(name=project_name,
1134+
dataset_name=dataset_name,
1135+
data_row_count=1)
11391136
project.connect_ontology(chat_evaluation_ontology)
11401137

11411138
project.upsert_instructions("tests/integration/media/sample_pdf.pdf")
@@ -1148,6 +1145,8 @@ def requested_labeling_service(
11481145

11491146
yield project, project.get_labeling_service()
11501147

1148+
teardown_helpers.teardown_project_labels_ontology_feature_schemas(project)
1149+
11511150

11521151
class TearDownHelpers:
11531152

libs/labelbox/tests/data/annotation_import/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,6 @@ def to_pascal_case(name: str) -> str:
22452245
def find_data_row_filter(data_row):
22462246
return lambda dr: dr["data_row"]["id"] == data_row.uid
22472247

2248-
22492248
@pytest.fixture
22502249
def helpers():
22512250
return Helpers

libs/labelbox/tests/integration/conftest.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,11 @@ def configured_project(
112112

113113

114114
@pytest.fixture
115-
def configured_project_with_complex_ontology(
116-
client, initial_dataset, rand_gen, image_url
117-
):
118-
project = client.create_project(
119-
name=rand_gen(str),
120-
queue_mode=QueueMode.Batch,
121-
media_type=MediaType.Image,
122-
)
115+
def configured_project_with_complex_ontology(client, initial_dataset, rand_gen,
116+
image_url, teardown_helpers):
117+
project = client.create_project(name=rand_gen(str),
118+
queue_mode=QueueMode.Batch,
119+
media_type=MediaType.Image)
123120
dataset = initial_dataset
124121
data_row = dataset.create_data_row(row_data=image_url)
125122
data_row_ids = [data_row.uid]
@@ -178,7 +175,7 @@ def configured_project_with_complex_ontology(
178175
project.setup(editor, ontology.asdict())
179176

180177
yield [project, data_row]
181-
project.delete()
178+
teardown_helpers.teardown_project_labels_ontology_feature_schemas(project)
182179

183180

184181
@pytest.fixture

0 commit comments

Comments
 (0)