diff --git a/tests/gateway/test_matrix_voice.py b/tests/gateway/test_matrix_voice.py index 2e1cdc0befa54..b113ba275cafd 100644 --- a/tests/gateway/test_matrix_voice.py +++ b/tests/gateway/test_matrix_voice.py @@ -26,7 +26,16 @@ from gateway.platforms.base import MessageType # --------------------------------------------------------------------------- def _make_adapter(): - """Create a MatrixAdapter with mocked config.""" + """Create a MatrixAdapter with mocked config. + + Pins ``require_mention: False`` so these media-detection tests are NOT + gated by the mention requirement. The adapter defaults require_mention to + True (falling back to the MATRIX_REQUIRE_MENTION env var), so without this + a group-room audio event with no @mention is dropped by + _resolve_message_context before dispatch — making the tests pass or fail + depending on leaked env state from other tests in the same shard. These + tests exercise voice/audio TYPE detection, not mention gating. + """ from plugins.platforms.matrix.adapter import MatrixAdapter from gateway.config import PlatformConfig @@ -36,6 +45,7 @@ def _make_adapter(): extra={ "homeserver": "https://matrix.example.org", "user_id": "@bot:example.org", + "require_mention": False, }, ) adapter = MatrixAdapter(config)