Skip to content

Commit 6146c7a

Browse files
committed
update to tests, docs, and adding -x flag to pytest
1 parent 7bdf91a commit 6146c7a

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[pytest]
2-
addopts = -s -vv --reruns 5 --reruns-delay 10
2+
addopts = -s -vv -x --reruns 5 --reruns-delay 10
33
markers =
44
slow: marks tests as slow (deselect with '-m "not slow"')

tests/integration/annotation_import/conftest.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,12 @@ def entity_inference(prediction_id_mapping):
223223
@pytest.fixture
224224
def segmentation_inference(prediction_id_mapping):
225225
segmentation = prediction_id_mapping['superpixel'].copy()
226-
segmentation.update(
227-
{'mask': {
228-
'instanceURI': "sampleuri",
226+
segmentation.update({
227+
'mask': {
228+
'instanceURI': "https://picsum.photos/200/300",
229229
'colorRGB': [0, 0, 0]
230-
}})
230+
}
231+
})
231232
del segmentation['tool']
232233
return segmentation
233234

@@ -252,7 +253,7 @@ def segmentation_inference_png(prediction_id_mapping):
252253
segmentation.update({
253254
'uuid': str(uuid.uuid4()),
254255
'mask': {
255-
'png': "somedata",
256+
'png': "https://picsum.photos/200/300",
256257
}
257258
})
258259
del segmentation['tool']

tests/integration/annotation_import/test_label_import.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ def test_create_from_url(client, project, annotation_import_test_helpers):
2020
annotation_import_test_helpers.check_running_state(label_import, name, url)
2121

2222

23-
def test_create_from_objects(client, project, object_predictions,
23+
def test_create_from_objects(client, configured_project, object_predictions,
2424
annotation_import_test_helpers):
25+
"""this test should check running state only to validate running, not completed"""
2526
name = str(uuid.uuid4())
2627

27-
label_import = LabelImport.create_from_objects(client=client,
28-
project_id=project.uid,
29-
name=name,
30-
labels=object_predictions)
31-
label_import.wait_until_done()
32-
assert label_import.parent_id == project.uid
28+
label_import = LabelImport.create_from_objects(
29+
client=client,
30+
project_id=configured_project.uid,
31+
name=name,
32+
labels=object_predictions)
33+
34+
assert label_import.parent_id == configured_project.uid
3335
annotation_import_test_helpers.check_running_state(label_import, name)
3436
annotation_import_test_helpers.assert_file_content(
3537
label_import.input_file_url, object_predictions)

0 commit comments

Comments
 (0)