FF [100%] =================================== FAILURES =================================== ___________ test_customer_dm_fallback_preserves_private_topic_route ____________ def test_customer_dm_fallback_preserves_private_topic_route() -> None: async def _run() -> None: adapter = object.__new__(TelegramAdapter) adapter._bot = AsyncMock() adapter._send_message_strict_topic = AsyncMock() adapter._thread_kwargs_for_send = lambda *_args: {} message = SimpleNamespace( chat=SimpleNamespace(id=200, type="private"), chat_id=200, from_user=SimpleNamespace(id=200), message_thread_id=None, ) transition = SimpleNamespace( reply=SimpleNamespace( prompt=None, callback_data="", notice="unsupported customer input", ), completion=None, ) bridge = SimpleNamespace(active_prompt_message_id=lambda: None) await adapter._render_nutrition_text(message, transition, bridge) adapter._bot.send_message.assert_awaited_once_with( chat_id="200", text="unsupported customer input", reply_markup=None, ) adapter._send_message_strict_topic.assert_not_awaited() > asyncio.run(_run()) tests/gateway/test_nutrition_coaching.py:7093: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../../miniconda3/lib/python3.12/asyncio/runners.py:195: in run return runner.run(main) ^^^^^^^^^^^^^^^^ ../../../miniconda3/lib/python3.12/asyncio/runners.py:118: in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ../../../miniconda3/lib/python3.12/asyncio/base_events.py:691: in run_until_complete return future.result() ^^^^^^^^^^^^^^^ tests/gateway/test_nutrition_coaching.py:7084: in _run await adapter._render_nutrition_text(message, transition, bridge) gateway/platforms/telegram.py:6128: in _render_nutrition_text sent = await self._send_nutrition_topic( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = chat_id = 200, topic_id = '1' kwargs = {'reply_markup': None, 'text': 'unsupported customer input'} thread_kwargs = {} async def _send_nutrition_topic( self, *, chat_id: object, topic_id: object, **kwargs: object, ) -> object: if str(topic_id) == "0": if self._bot is None: raise RuntimeError("Not connected") return await self._bot.send_message(chat_id=chat_id, **kwargs) thread_kwargs = self._thread_kwargs_for_send( str(chat_id), str(topic_id), {"thread_id": str(topic_id)}, ) if thread_kwargs.get("message_thread_id") is None: > raise RuntimeError("strict topic delivery requires message_thread_id") E RuntimeError: strict topic delivery requires message_thread_id gateway/platforms/telegram.py:5690: RuntimeError _________ test_ptb_error_logs_safe_exception_metadata_without_content __________ caplog = <_pytest.logging.LogCaptureFixture object at 0x723ac5f86f90> @pytest.mark.asyncio async def test_ptb_error_logs_safe_exception_metadata_without_content( caplog: pytest.LogCaptureFixture, ) -> None: adapter = object.__new__(TelegramAdapter) adapter._telegram_polling_receipt_gate = None update = SimpleNamespace( update_id=629525116, message=SimpleNamespace(text="private-update-content"), ) try: raise KeyError("private-exception-content") except KeyError as error: context = SimpleNamespace(error=error) with caplog.at_level("ERROR", logger="gateway.platforms.telegram"): await adapter._handle_ptb_error(update, context) > assert "builtins.KeyError" in caplog.text E AssertionError: assert 'builtins.KeyError' in '' E + where '' = <_pytest.logging.LogCaptureFixture object at 0x723ac5f86f90>.text tests/gateway/test_telegram_polling_receipts.py:585: AssertionError =========================== short test summary info ============================ FAILED tests/gateway/test_nutrition_coaching.py::test_customer_dm_fallback_preserves_private_topic_route FAILED tests/gateway/test_telegram_polling_receipts.py::test_ptb_error_logs_safe_exception_metadata_without_content 2 failed in 0.50s