@@ -411,7 +411,7 @@ def conversation_entity_data_row(client, rand_gen):
411
411
}
412
412
413
413
414
- @pytest .fixture
414
+ @pytest .fixture ( scope = 'module' )
415
415
def project (client , rand_gen ):
416
416
project = client .create_project (name = rand_gen (str ),
417
417
queue_mode = QueueMode .Batch ,
@@ -420,7 +420,7 @@ def project(client, rand_gen):
420
420
project .delete ()
421
421
422
422
423
- @pytest .fixture
423
+ @pytest .fixture ( scope = 'module' )
424
424
def consensus_project (client , rand_gen ):
425
425
project = client .create_project (name = rand_gen (str ),
426
426
quality_mode = QualityMode .Consensus ,
@@ -440,7 +440,7 @@ def model_config(client, rand_gen, valid_model_id):
440
440
client .delete_model_config (model_config .uid )
441
441
442
442
443
- @pytest .fixture
443
+ @pytest .fixture ( scope = 'module' )
444
444
def consensus_project_with_batch (consensus_project , initial_dataset , rand_gen ,
445
445
image_url ):
446
446
project = consensus_project
@@ -468,21 +468,21 @@ def consensus_project_with_batch(consensus_project, initial_dataset, rand_gen,
468
468
batch .delete ()
469
469
470
470
471
- @pytest .fixture
471
+ @pytest .fixture ( scope = 'module' )
472
472
def dataset (client , rand_gen ):
473
473
dataset = client .create_dataset (name = rand_gen (str ))
474
474
yield dataset
475
475
dataset .delete ()
476
476
477
477
478
- @pytest .fixture (scope = 'function ' )
478
+ @pytest .fixture (scope = 'module ' )
479
479
def unique_dataset (client , rand_gen ):
480
480
dataset = client .create_dataset (name = rand_gen (str ))
481
481
yield dataset
482
482
dataset .delete ()
483
483
484
484
485
- @pytest .fixture
485
+ @pytest .fixture ( scope = 'module' )
486
486
def small_dataset (dataset : Dataset ):
487
487
task = dataset .create_data_rows ([
488
488
{
@@ -495,7 +495,7 @@ def small_dataset(dataset: Dataset):
495
495
yield dataset
496
496
497
497
498
- @pytest .fixture
498
+ @pytest .fixture ( scope = 'module' )
499
499
def data_row (dataset , image_url , rand_gen ):
500
500
global_key = f"global-key-{ rand_gen (str )} "
501
501
task = dataset .create_data_rows ([
@@ -511,7 +511,7 @@ def data_row(dataset, image_url, rand_gen):
511
511
dr .delete ()
512
512
513
513
514
- @pytest .fixture
514
+ @pytest .fixture ( scope = 'module' )
515
515
def data_row_and_global_key (dataset , image_url , rand_gen ):
516
516
global_key = f"global-key-{ rand_gen (str )} "
517
517
task = dataset .create_data_rows ([
@@ -530,7 +530,7 @@ def data_row_and_global_key(dataset, image_url, rand_gen):
530
530
# can be used with
531
531
# @pytest.mark.parametrize('data_rows', [<count of data rows>], indirect=True)
532
532
# if omitted, count defaults to 1
533
- @pytest .fixture
533
+ @pytest .fixture ( scope = 'module' )
534
534
def data_rows (dataset , image_url , request , wait_for_data_row_processing ,
535
535
client ):
536
536
count = 1
@@ -670,7 +670,7 @@ def _setup_ontology(project):
670
670
return OntologyBuilder .from_project (project )
671
671
672
672
673
- @pytest .fixture
673
+ @pytest .fixture ( scope = 'module' )
674
674
def big_dataset (dataset : Dataset ):
675
675
task = dataset .create_data_rows ([
676
676
{
@@ -683,7 +683,7 @@ def big_dataset(dataset: Dataset):
683
683
yield dataset
684
684
685
685
686
- @pytest .fixture
686
+ @pytest .fixture ( scope = 'module' )
687
687
def configured_batch_project_with_label (project , dataset , data_row ,
688
688
wait_for_label_processing ):
689
689
"""Project with a batch having one datarow
@@ -707,7 +707,7 @@ def configured_batch_project_with_label(project, dataset, data_row,
707
707
label .delete ()
708
708
709
709
710
- @pytest .fixture
710
+ @pytest .fixture ( scope = 'module' )
711
711
def configured_batch_project_with_multiple_datarows (project , dataset , data_rows ,
712
712
wait_for_label_processing ):
713
713
"""Project with a batch having multiple datarows
@@ -798,7 +798,7 @@ def initial_dataset(client, rand_gen):
798
798
dataset .delete ()
799
799
800
800
801
- @pytest .fixture
801
+ @pytest .fixture ( scope = 'session' )
802
802
def video_data (client , rand_gen , video_data_row , wait_for_data_row_processing ):
803
803
dataset = client .create_dataset (name = rand_gen (str ))
804
804
data_row_ids = []
@@ -820,7 +820,7 @@ def create_video_data_row(rand_gen):
820
820
}
821
821
822
822
823
- @pytest .fixture
823
+ @pytest .fixture ( scope = 'session' )
824
824
def video_data_100_rows (client , rand_gen , wait_for_data_row_processing ):
825
825
dataset = client .create_dataset (name = rand_gen (str ))
826
826
data_row_ids = []
@@ -832,7 +832,7 @@ def video_data_100_rows(client, rand_gen, wait_for_data_row_processing):
832
832
dataset .delete ()
833
833
834
834
835
- @pytest .fixture ()
835
+ @pytest .fixture
836
836
def video_data_row (rand_gen ):
837
837
return create_video_data_row (rand_gen )
838
838
@@ -929,15 +929,15 @@ def export_v2_test_helpers() -> Type[ExportV2Helpers]:
929
929
return ExportV2Helpers ()
930
930
931
931
932
- @pytest .fixture
932
+ @pytest .fixture ( scope = 'session' )
933
933
def big_dataset_data_row_ids (big_dataset : Dataset ):
934
934
export_task = big_dataset .export ()
935
935
export_task .wait_till_done ()
936
936
stream = export_task .get_buffered_stream ()
937
937
yield [dr .json ["data_row" ]["id" ] for dr in stream ]
938
938
939
939
940
- @pytest .fixture ( scope = 'function' )
940
+ @pytest .fixture
941
941
def dataset_with_invalid_data_rows (unique_dataset : Dataset ,
942
942
upload_invalid_data_rows_for_dataset ):
943
943
upload_invalid_data_rows_for_dataset (unique_dataset )
@@ -989,7 +989,7 @@ def project_with_empty_ontology(project):
989
989
yield project
990
990
991
991
992
- @pytest .fixture
992
+ @pytest .fixture ( scope = 'module' )
993
993
def configured_project_with_complex_ontology (client , initial_dataset , rand_gen ,
994
994
image_url ):
995
995
project = client .create_project (name = rand_gen (str ),
0 commit comments