Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
fix test_groups_single_subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed Jan 9, 2022
1 parent 8039121 commit cb56394
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions mailerlite/tests/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,23 @@ def test_groups_single_subscriber(header):
groups = Groups(header)

n_groups = groups.all()
assert len(n_groups) > 0
group_1 = n_groups[0]
if not len(n_groups):
pytest.skip("No groups found")

try:
group_1 = n_groups[0]
except IndexError:
pytest.skip("Group index not found. Maybe deleted by another thread")

subs_in_group_1 = groups.subscribers(group_1.id)
assert len(subs_in_group_1) > 0
if not len(subs_in_group_1):
pytest.skip("No subscriber found in this group.")

try:
sub1 = subs_in_group_1[0]
except IndexError:
pytest.skip("Subscriber not found. Maybe deleted by another thread")

sub1 = subs_in_group_1[0]
tmp_sub = groups.subscriber(group_1.id, sub1.id)

assert sub1.email == tmp_sub.email
Expand All @@ -158,7 +168,6 @@ def test_groups_single_subscriber(header):
else:
break

# print(new_sub)
if new_sub:
assert new_sub.email == mail

Expand Down

0 comments on commit cb56394

Please sign in to comment.