66)
77from labelbox .schema .user_group import UserGroup , UserGroupColor
88
9- from libs .labelbox .tests .conftest import AdminClient
9+ from libs .labelbox .tests .conftest import AdminClient , Environ
1010import os
1111
1212data = faker .Faker ()
@@ -32,8 +32,9 @@ def user_group(client):
3232
3333@pytest .fixture (scope = "module" )
3434def test_member (client , current_member , admin_client : AdminClient ):
35+ admin_client = admin_client (Environ .STAGING )
3536 admin_client ._create_user (client .get_organization ().uid )
36- members = list (Member (client = client ).get_members ())
37+ members = list (
Member (
client = client ).
get_members (
search = "[email protected] " ))
3738 test_member = None
3839 for member in members :
3940 if member .id != current_member .id :
@@ -56,7 +57,10 @@ def test_throw_error_when_deleting_self(current_member):
5657 current_member .delete ()
5758
5859
59- @pytest .mark .skipif (condition = os .environ ["LABELBOX_TEST_ENVIRON" ] != "staging" )
60+ @pytest .mark .skipif (
61+ condition = os .environ ["LABELBOX_TEST_ENVIRON" ] != "staging" ,
62+ reason = "admin client only works in staging" ,
63+ )
6064def test_update_member (client , test_member , project_pack , user_group ):
6165 labeler_role = client .get_roles ()["LABELER" ]
6266 reviewer_role = client .get_roles ()["REVIEWER" ]
@@ -103,7 +107,10 @@ def test_update_member(client, test_member, project_pack, user_group):
103107 assert updated_member .can_access_all_projects
104108
105109
106- @pytest .mark .skipif (condition = os .environ ["LABELBOX_TEST_ENVIRON" ] != "staging" )
110+ @pytest .mark .skipif (
111+ condition = os .environ ["LABELBOX_TEST_ENVIRON" ] != "staging" ,
112+ reason = "admin client only works in staging" ,
113+ )
107114def test_get_members (test_member , current_member , client ):
108115 member_ids = [
109116 member .id
@@ -120,13 +127,16 @@ def test_get_members(test_member, current_member, client):
120127 assert current_member .id in member_ids
121128
122129
123- @pytest .mark .skipif (condition = os .environ ["LABELBOX_TEST_ENVIRON" ] != "staging" )
124- def test_delete_member (test_member , current_member , client ):
130+ @pytest .mark .skipif (
131+ condition = os .environ ["LABELBOX_TEST_ENVIRON" ] != "staging" ,
132+ reason = "admin client only works in staging" ,
133+ )
134+ def test_delete_member (test_member , current_member ):
125135 email = test_member .email
126136 id = test_member .id
127137 test_member .delete ()
128138 member_ids = [
129- member .id for member in Member ( client = client ) .get_members (search = email )
139+ member .id for member in current_member .get_members (search = email )
130140 ]
131141 assert id not in member_ids
132142
0 commit comments