@@ -25,16 +25,53 @@ def pytest_configure(config):
2525 config .addinivalue_line ("markers" , "incremental: mark test incremental" )
2626
2727
28+ def _baseline_app_config (stream_client : StreamChat ) -> None :
29+ """Reset the shared CI test app to a permissive upload + command config.
30+
31+ Pinning state here is safer than skip-on-error guards inside individual
32+ tests — those silently mask drift. Empty allow/block lists on every gate
33+ (extensions AND MIME types) means 'no restrictions' per backend
34+ ``FileUploadConfig.Validate`` in ``controllers/types.go``. Re-registering
35+ the default ``messaging`` channel-type commands keeps ``/giphy``
36+ parseable for ``run_message_action``.
37+
38+ Best-effort: a test app that doesn't expose either endpoint falls
39+ through and the individual tests surface the real failure.
40+ """
41+ permissive = {
42+ "allowed_file_extensions" : [],
43+ "blocked_file_extensions" : [],
44+ "allowed_mime_types" : [],
45+ "blocked_mime_types" : [],
46+ }
47+ try :
48+ stream_client .update_app_settings (
49+ file_upload_config = permissive ,
50+ image_upload_config = permissive ,
51+ )
52+ except Exception :
53+ pass
54+ try :
55+ stream_client .update_channel_type (
56+ "messaging" ,
57+ commands = ["giphy" , "imgur" , "flag" , "ban" , "mute" , "unban" , "unmute" ],
58+ )
59+ except Exception :
60+ pass
61+
62+
2863@pytest .fixture (scope = "module" )
2964def client ():
3065 base_url = os .environ .get ("STREAM_HOST" )
3166 options = {"base_url" : base_url } if base_url else {}
32- return StreamChat (
67+ stream_client = StreamChat (
3368 api_key = os .environ ["STREAM_KEY" ],
3469 api_secret = os .environ ["STREAM_SECRET" ],
3570 timeout = 10 ,
3671 ** options ,
3772 )
73+ _baseline_app_config (stream_client )
74+ return stream_client
3875
3976
4077@pytest .fixture (scope = "function" )
0 commit comments