1010"""
1111
1212
13- def test_create_from_url (client , model_run_with_model_run_data_rows ,
13+ def test_create_from_url (model_run_with_model_run_data_rows ,
1414 annotation_import_test_helpers ):
1515 name = str (uuid .uuid4 ())
1616 url = "https://storage.googleapis.com/labelbox-public-bucket/predictions_test_v2.ndjson"
@@ -19,20 +19,10 @@ def test_create_from_url(client, model_run_with_model_run_data_rows,
1919 assert annotation_import .model_run_id == model_run_with_model_run_data_rows .uid
2020 annotation_import_test_helpers .check_running_state (annotation_import , name ,
2121 url )
22- import_id = client .execute (
23- """query get_mea_importPyApi($model_run_id: ID!) {
24- modelErrorAnalysisPredictionImports(where: {modelRunId: $model_run_id}) {
25- id
26- }}""" , {"model_run_id" : annotation_import .parent_id
27- })['modelErrorAnalysisPredictionImports' ][0 ]['id' ]
28- client .execute (
29- """mutation deleteModelErrorAnalysisPredictionImportPyApi($import_id: ID!) {
30- deleteModelErrorAnalysisPredictionImport(where: {id: $import_id}) {
31- id
32- }}""" , {"import_id" : import_id })
33-
34-
35- def test_create_from_objects (client , model_run_with_model_run_data_rows ,
22+ annotation_import .wait_until_done ()
23+
24+
25+ def test_create_from_objects (model_run_with_model_run_data_rows ,
3626 object_predictions ,
3727 annotation_import_test_helpers ):
3828 name = str (uuid .uuid4 ())
@@ -44,21 +34,10 @@ def test_create_from_objects(client, model_run_with_model_run_data_rows,
4434 annotation_import_test_helpers .check_running_state (annotation_import , name )
4535 annotation_import_test_helpers .assert_file_content (
4636 annotation_import .input_file_url , object_predictions )
47- import_id = client .execute (
48- """query get_mea_importPyApi($model_run_id: ID!) {
49- modelErrorAnalysisPredictionImports(where: {modelRunId: $model_run_id}) {
50- id
51- }}""" , {"model_run_id" : annotation_import .parent_id
52- })['modelErrorAnalysisPredictionImports' ][0 ]['id' ]
53- client .execute (
54- """mutation deleteModelErrorAnalysisPredictionImportPyApi($import_id: ID!) {
55- deleteModelErrorAnalysisPredictionImport(where: {id: $import_id}) {
56- id
57- }}""" , {"import_id" : import_id })
58-
59-
60- def test_create_from_local_file (client , tmp_path ,
61- model_run_with_model_run_data_rows ,
37+ annotation_import .wait_until_done ()
38+
39+
40+ def test_create_from_local_file (tmp_path , model_run_with_model_run_data_rows ,
6241 object_predictions ,
6342 annotation_import_test_helpers ):
6443 name = str (uuid .uuid4 ())
@@ -74,17 +53,7 @@ def test_create_from_local_file(client, tmp_path,
7453 annotation_import_test_helpers .check_running_state (annotation_import , name )
7554 annotation_import_test_helpers .assert_file_content (
7655 annotation_import .input_file_url , object_predictions )
77- import_id = client .execute (
78- """query get_mea_importPyApi($model_run_id: ID!) {
79- modelErrorAnalysisPredictionImports(where: {modelRunId: $model_run_id}) {
80- id
81- }}""" , {"model_run_id" : annotation_import .parent_id
82- })['modelErrorAnalysisPredictionImports' ][0 ]['id' ]
83- client .execute (
84- """mutation deleteModelErrorAnalysisPredictionImportPyApi($import_id: ID!) {
85- deleteModelErrorAnalysisPredictionImport(where: {id: $import_id}) {
86- id
87- }}""" , {"import_id" : import_id })
56+ annotation_import .wait_until_done ()
8857
8958
9059def test_get (client , model_run_with_model_run_data_rows ,
@@ -100,17 +69,7 @@ def test_get(client, model_run_with_model_run_data_rows,
10069 assert annotation_import .model_run_id == model_run_with_model_run_data_rows .uid
10170 annotation_import_test_helpers .check_running_state (annotation_import , name ,
10271 url )
103- import_id = client .execute (
104- """query get_mea_importPyApi($model_run_id: ID!) {
105- modelErrorAnalysisPredictionImports(where: {modelRunId: $model_run_id}) {
106- id
107- }}""" , {"model_run_id" : annotation_import .parent_id
108- })['modelErrorAnalysisPredictionImports' ][0 ]['id' ]
109- client .execute (
110- """mutation deleteModelErrorAnalysisPredictionImportPyApi($import_id: ID!) {
111- deleteModelErrorAnalysisPredictionImport(where: {id: $import_id}) {
112- id
113- }}""" , {"import_id" : import_id })
72+ annotation_import .wait_until_done ()
11473
11574
11675@pytest .mark .slow
0 commit comments