<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="2" skipped="0" tests="2" time="0.501" timestamp="2026-08-17T09:09:40.545981+09:00" hostname="cube-B850M-AORUS-ELITE-WIFI6E-ICE"><testcase classname="tests.gateway.test_nutrition_coaching" name="test_customer_dm_fallback_preserves_private_topic_route" time="0.011"><failure message="RuntimeError: strict topic delivery requires message_thread_id">def test_customer_dm_fallback_preserves_private_topic_route() -&gt; None:
        async def _run() -&gt; 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()
    
&gt;       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 = &lt;gateway.platforms.telegram.TelegramAdapter object at 0x723ac606cdd0&gt;
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,
    ) -&gt; 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:
&gt;           raise RuntimeError("strict topic delivery requires message_thread_id")
E           RuntimeError: strict topic delivery requires message_thread_id

gateway/platforms/telegram.py:5690: RuntimeError</failure></testcase><testcase classname="tests.gateway.test_telegram_polling_receipts" name="test_ptb_error_logs_safe_exception_metadata_without_content" time="0.006"><failure message="AssertionError: assert 'builtins.KeyError' in ''&#10; +  where '' = &lt;_pytest.logging.LogCaptureFixture object at 0x723ac5f86f90&gt;.text">caplog = &lt;_pytest.logging.LogCaptureFixture object at 0x723ac5f86f90&gt;

    @pytest.mark.asyncio
    async def test_ptb_error_logs_safe_exception_metadata_without_content(
        caplog: pytest.LogCaptureFixture,
    ) -&gt; 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)
    
&gt;       assert "builtins.KeyError" in caplog.text
E       AssertionError: assert 'builtins.KeyError' in ''
E        +  where '' = &lt;_pytest.logging.LogCaptureFixture object at 0x723ac5f86f90&gt;.text

tests/gateway/test_telegram_polling_receipts.py:585: AssertionError</failure></testcase></testsuite></testsuites>