Skip to content

Commit c1218ca

Browse files
chore(tests): relax test_list_blocklists count assertion
The shared CI test app accumulates blocklists from prior runs whose after-test delete didn't fire (CI abort, parallel run racing, etc). test_list_blocklists pins 'len(blocklists) == 3' (the two server defaults plus the 'Foo' fixture this test creates) and goes red as soon as that sediment piles up: 'expected: 3, got: 15'. The create-side of the contract is what this test actually exercises; the 'Foo' in names assertion already proves it. Loosen the count to >= 3 so a polluted app doesn't take down unrelated PRs while keeping the create signal. The .jpg upload and /giphy run_message_action tests on the same CI matrix also fail intermittently due to app-config drift (uploads MIME-type allowlist excluding image/jpeg, messaging channel-type missing the giphy command). Those need backend-side fixture work that's out of scope for this single chore PR — filing separately. Applied to both sync and async variants.
1 parent cb36a31 commit c1218ca

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

stream_chat/tests/async_chat/test_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,9 @@ async def test_create_blocklist(self, client: StreamChatAsync):
669669

670670
async def test_list_blocklists(self, client: StreamChatAsync):
671671
response = await client.list_blocklists()
672-
assert len(response["blocklists"]) == 3
672+
# Don't pin the exact count: the shared test app accumulates blocklists
673+
# across CI runs where teardown didn't get to run.
674+
assert len(response["blocklists"]) >= 3
673675
blocklist_names = {blocklist["name"] for blocklist in response["blocklists"]}
674676
assert "Foo" in blocklist_names
675677

stream_chat/tests/test_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,9 @@ def test_create_blocklist(self, client: StreamChat):
689689

690690
def test_list_blocklists(self, client: StreamChat):
691691
response = client.list_blocklists()
692-
assert len(response["blocklists"]) == 3
692+
# Don't pin the exact count: the shared test app accumulates blocklists
693+
# across CI runs where teardown didn't get to run.
694+
assert len(response["blocklists"]) >= 3
693695
blocklist_names = {blocklist["name"] for blocklist in response["blocklists"]}
694696
assert "Foo" in blocklist_names
695697

0 commit comments

Comments
 (0)