Просмотр исходного кода

cleanup(tests): remove test for log message for unmatched product during discovery

Jason Rumney 19 часов назад
Родитель
Сommit
b2cdb21995
1 измененных файлов с 26 добавлено и 26 удалено
  1. 26 26
      tests/test_discovery.py

+ 26 - 26
tests/test_discovery.py

@@ -214,32 +214,32 @@ def _patch_flow_init(hass, mocker):
     )
 
 
-@pytest.mark.asyncio
-async def test_product_scan_warns_once_on_unmatched_product(hass, caplog, mocker):
-    """An unmatched product id is logged at WARNING, once per device per run."""
-    _make_entry(hass, host="192.168.1.10")
-    mocker.patch(
-        "custom_components.tuya_local.discovery._scan_all",
-        return_value=_scan_result(),
-    )
-    mocker.patch(
-        "custom_components.tuya_local.discovery.get_config",
-        return_value=_fake_config(False),
-    )
-    _patch_flow_init(hass, mocker)
-    disc = TuyaLANRediscovery(hass)
-
-    with caplog.at_level(
-        logging.WARNING, logger="custom_components.tuya_local.discovery"
-    ):
-        await disc._async_discovery_scan()
-        await hass.async_block_till_done()
-        assert caplog.text.count("keyabc123") == 1
-        # A second scan must not warn again for the same device.
-        caplog.clear()
-        await disc._async_discovery_scan()
-        await hass.async_block_till_done()
-        assert "keyabc123" not in caplog.text
+# @pytest.mark.asyncio
+# async def test_product_scan_warns_once_on_unmatched_product(hass, caplog, mocker):
+#     """An unmatched product id is logged at WARNING, once per device per run."""
+#     _make_entry(hass, host="192.168.1.10")
+#     mocker.patch(
+#         "custom_components.tuya_local.discovery._scan_all",
+#         return_value=_scan_result(),
+#     )
+#     mocker.patch(
+#         "custom_components.tuya_local.discovery.get_config",
+#         return_value=_fake_config(False),
+#     )
+#     _patch_flow_init(hass, mocker)
+#     disc = TuyaLANRediscovery(hass)
+
+#     with caplog.at_level(
+#         logging.WARNING, logger="custom_components.tuya_local.discovery"
+#     ):
+#         await disc._async_discovery_scan()
+#         await hass.async_block_till_done()
+#         assert caplog.text.count("keyabc123") == 1
+#         # A second scan must not warn again for the same device.
+#         caplog.clear()
+#         await disc._async_discovery_scan()
+#         await hass.async_block_till_done()
+#         assert "keyabc123" not in caplog.text
 
 
 @pytest.mark.asyncio