Skip to content

Commit dd7d8e8

Browse files
committed
improved test where
1 parent 37f4386 commit dd7d8e8

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

libs/labelbox/tests/integration/test_filtering.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,29 @@
33
from labelbox import Project
44
from labelbox.exceptions import InvalidQueryError
55
from labelbox.schema.queue_mode import QueueMode
6+
from labelbox import MediaType
7+
import time
68

79

810
@pytest.fixture
911
def project_to_test_where(client, rand_gen):
12+
num_retries = 5
13+
1014
p_a_name = f"a-{rand_gen(str)}"
1115
p_b_name = f"b-{rand_gen(str)}"
1216
p_c_name = f"c-{rand_gen(str)}"
13-
14-
p_a = client.create_project(name=p_a_name, queue_mode=QueueMode.Batch)
15-
p_b = client.create_project(name=p_b_name, queue_mode=QueueMode.Batch)
16-
p_c = client.create_project(name=p_c_name, queue_mode=QueueMode.Batch)
17+
18+
p_a = client.create_project(name=p_a_name, media_type=MediaType.Image)
19+
p_b = client.create_project(name=p_b_name, media_type=MediaType.Image)
20+
p_c = client.create_project(name=p_c_name, media_type=MediaType.Image)
21+
22+
while (num_retries > 0):
23+
projects = client.get_projects()
24+
if projects is None or len(list(projects)) != 3:
25+
num_retries -= 1
26+
time.sleep(5)
27+
else:
28+
break
1729

1830
yield p_a, p_b, p_c
1931

0 commit comments

Comments
 (0)