diff --git a/tests/components/mqtt/test_button.py b/tests/components/mqtt/test_button.py index 481e98f00997ed..35b6561895d9fe 100644 --- a/tests/components/mqtt/test_button.py +++ b/tests/components/mqtt/test_button.py @@ -443,7 +443,7 @@ async def test_entity_debug_info_message( mqtt.DOMAIN: { button.DOMAIN: { "name": "test", - "state_topic": "test-topic", + "command_topic": "test-topic", "device_class": "foobarnotreal", } } @@ -451,11 +451,14 @@ async def test_entity_debug_info_message( ], ) async def test_invalid_device_class( - hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator + hass: HomeAssistant, + mqtt_mock_entry: MqttMockHAClientGenerator, + caplog: pytest.LogCaptureFixture, ) -> None: """Test device_class option with invalid value.""" with pytest.raises(AssertionError): await mqtt_mock_entry() + assert "expected ButtonDeviceClass" in caplog.text @pytest.mark.parametrize(