Skip to content

Commit 2d4e59f

Browse files
author
Matt Sokoloff
committed
improve test stability
1 parent 904d4dc commit 2d4e59f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test-staging: build
66
docker run -it -v ${PWD}:/usr/src -w /usr/src \
77
-e LABELBOX_TEST_ENVIRON="staging" \
88
-e LABELBOX_TEST_API_KEY_STAGING=${LABELBOX_TEST_API_KEY_STAGING} \
9-
local/labelbox-python:test pytest $(PATH_TO_TEST) -svv
9+
local/labelbox-python:test pytest $(PATH_TO_TEST) -svvx
1010

1111
test-prod: build
1212
docker run -it -v ${PWD}:/usr/src -w /usr/src \

tests/integration/bulk_import/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ def configured_project(client, ontology, rand_gen):
110110
client.get_labeling_frontends(
111111
where=LabelingFrontend.name == "editor"))[0]
112112
project.setup(editor, ontology)
113+
data_row_ids = []
113114
for _ in range(len(ontology['tools']) + len(ontology['classifications'])):
114-
dataset.create_data_row(row_data=IMG_URL)
115+
data_row_ids.append(dataset.create_data_row(row_data=IMG_URL).uid)
115116
project.datasets.connect(dataset)
117+
project.data_row_ids = data_row_ids
116118
yield project
117119
project.delete()
118120
dataset.delete()
@@ -122,7 +124,6 @@ def configured_project(client, ontology, rand_gen):
122124
def prediction_id_mapping(configured_project):
123125
#Maps tool types to feature schema ids
124126
ontology = configured_project.ontology().normalized
125-
datarows = [d for d in list(configured_project.datasets())[0].data_rows()]
126127
result = {}
127128

128129
for idx, tool in enumerate(ontology['tools'] + ontology['classifications']):
@@ -134,7 +135,7 @@ def prediction_id_mapping(configured_project):
134135
"uuid": str(uuid.uuid4()),
135136
"schemaId": tool['featureSchemaId'],
136137
"dataRow": {
137-
"id": datarows[idx].uid,
138+
"id": configured_project.data_row_ids[idx],
138139
},
139140
'tool': tool
140141
}

0 commit comments

Comments
 (0)