Skip to content

Commit c85969c

Browse files
author
Adrian Chang
committed
fix fixtures
1 parent 5f843ca commit c85969c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

libs/labelbox/tests/conftest.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def conversation_entity_data_row(client, rand_gen):
411411
}
412412

413413

414-
@pytest.fixture
414+
@pytest.fixture(scope='module')
415415
def project(client, rand_gen):
416416
project = client.create_project(name=rand_gen(str),
417417
queue_mode=QueueMode.Batch,
@@ -420,7 +420,7 @@ def project(client, rand_gen):
420420
project.delete()
421421

422422

423-
@pytest.fixture
423+
@pytest.fixture(scope='module')
424424
def consensus_project(client, rand_gen):
425425
project = client.create_project(name=rand_gen(str),
426426
quality_mode=QualityMode.Consensus,
@@ -440,7 +440,7 @@ def model_config(client, rand_gen, valid_model_id):
440440
client.delete_model_config(model_config.uid)
441441

442442

443-
@pytest.fixture
443+
@pytest.fixture(scope='module')
444444
def consensus_project_with_batch(consensus_project, initial_dataset, rand_gen,
445445
image_url):
446446
project = consensus_project
@@ -468,21 +468,21 @@ def consensus_project_with_batch(consensus_project, initial_dataset, rand_gen,
468468
batch.delete()
469469

470470

471-
@pytest.fixture
471+
@pytest.fixture(scope='module')
472472
def dataset(client, rand_gen):
473473
dataset = client.create_dataset(name=rand_gen(str))
474474
yield dataset
475475
dataset.delete()
476476

477477

478-
@pytest.fixture(scope='function')
478+
@pytest.fixture(scope='module')
479479
def unique_dataset(client, rand_gen):
480480
dataset = client.create_dataset(name=rand_gen(str))
481481
yield dataset
482482
dataset.delete()
483483

484484

485-
@pytest.fixture
485+
@pytest.fixture(scope='module')
486486
def small_dataset(dataset: Dataset):
487487
task = dataset.create_data_rows([
488488
{
@@ -495,7 +495,7 @@ def small_dataset(dataset: Dataset):
495495
yield dataset
496496

497497

498-
@pytest.fixture
498+
@pytest.fixture(scope='module')
499499
def data_row(dataset, image_url, rand_gen):
500500
global_key = f"global-key-{rand_gen(str)}"
501501
task = dataset.create_data_rows([
@@ -511,7 +511,7 @@ def data_row(dataset, image_url, rand_gen):
511511
dr.delete()
512512

513513

514-
@pytest.fixture
514+
@pytest.fixture(scope='module')
515515
def data_row_and_global_key(dataset, image_url, rand_gen):
516516
global_key = f"global-key-{rand_gen(str)}"
517517
task = dataset.create_data_rows([
@@ -530,7 +530,7 @@ def data_row_and_global_key(dataset, image_url, rand_gen):
530530
# can be used with
531531
# @pytest.mark.parametrize('data_rows', [<count of data rows>], indirect=True)
532532
# if omitted, count defaults to 1
533-
@pytest.fixture
533+
@pytest.fixture(scope='module')
534534
def data_rows(dataset, image_url, request, wait_for_data_row_processing,
535535
client):
536536
count = 1
@@ -670,7 +670,7 @@ def _setup_ontology(project):
670670
return OntologyBuilder.from_project(project)
671671

672672

673-
@pytest.fixture
673+
@pytest.fixture(scope='module')
674674
def big_dataset(dataset: Dataset):
675675
task = dataset.create_data_rows([
676676
{
@@ -683,7 +683,7 @@ def big_dataset(dataset: Dataset):
683683
yield dataset
684684

685685

686-
@pytest.fixture
686+
@pytest.fixture(scope='module')
687687
def configured_batch_project_with_label(project, dataset, data_row,
688688
wait_for_label_processing):
689689
"""Project with a batch having one datarow
@@ -707,7 +707,7 @@ def configured_batch_project_with_label(project, dataset, data_row,
707707
label.delete()
708708

709709

710-
@pytest.fixture
710+
@pytest.fixture(scope='module')
711711
def configured_batch_project_with_multiple_datarows(project, dataset, data_rows,
712712
wait_for_label_processing):
713713
"""Project with a batch having multiple datarows
@@ -798,7 +798,7 @@ def initial_dataset(client, rand_gen):
798798
dataset.delete()
799799

800800

801-
@pytest.fixture
801+
@pytest.fixture(scope='session')
802802
def video_data(client, rand_gen, video_data_row, wait_for_data_row_processing):
803803
dataset = client.create_dataset(name=rand_gen(str))
804804
data_row_ids = []
@@ -820,7 +820,7 @@ def create_video_data_row(rand_gen):
820820
}
821821

822822

823-
@pytest.fixture
823+
@pytest.fixture(scope='session')
824824
def video_data_100_rows(client, rand_gen, wait_for_data_row_processing):
825825
dataset = client.create_dataset(name=rand_gen(str))
826826
data_row_ids = []
@@ -832,7 +832,7 @@ def video_data_100_rows(client, rand_gen, wait_for_data_row_processing):
832832
dataset.delete()
833833

834834

835-
@pytest.fixture()
835+
@pytest.fixture
836836
def video_data_row(rand_gen):
837837
return create_video_data_row(rand_gen)
838838

@@ -929,15 +929,15 @@ def export_v2_test_helpers() -> Type[ExportV2Helpers]:
929929
return ExportV2Helpers()
930930

931931

932-
@pytest.fixture
932+
@pytest.fixture(scope='session')
933933
def big_dataset_data_row_ids(big_dataset: Dataset):
934934
export_task = big_dataset.export()
935935
export_task.wait_till_done()
936936
stream = export_task.get_buffered_stream()
937937
yield [dr.json["data_row"]["id"] for dr in stream]
938938

939939

940-
@pytest.fixture(scope='function')
940+
@pytest.fixture
941941
def dataset_with_invalid_data_rows(unique_dataset: Dataset,
942942
upload_invalid_data_rows_for_dataset):
943943
upload_invalid_data_rows_for_dataset(unique_dataset)
@@ -989,7 +989,7 @@ def project_with_empty_ontology(project):
989989
yield project
990990

991991

992-
@pytest.fixture
992+
@pytest.fixture(scope='module')
993993
def configured_project_with_complex_ontology(client, initial_dataset, rand_gen,
994994
image_url):
995995
project = client.create_project(name=rand_gen(str),

0 commit comments

Comments
 (0)