diff --git a/tests/components/rflink/test_binary_sensor.py b/tests/components/rflink/test_binary_sensor.py index 6b8ce286fd9..6bce2f6cab2 100644 --- a/tests/components/rflink/test_binary_sensor.py +++ b/tests/components/rflink/test_binary_sensor.py @@ -87,23 +87,26 @@ async def test_default_setup( assert hass.states.get("binary_sensor.test").state == STATE_OFF -@pytest.mark.xfail( - reason="Flaky due to Python 3.14.3 asyncio changes - see home-assistant/core#162263" -) async def test_entity_availability( hass: HomeAssistant, monkeypatch: pytest.MonkeyPatch ) -> None: """If Rflink device is disconnected, entities should become unavailable.""" # Make sure Rflink mock does not 'recover' to quickly from the # disconnect or else the unavailability cannot be measured - config = CONFIG - failures = [True, True] - config[CONF_RECONNECT_INTERVAL] = 60 + config = { + **CONFIG, + "rflink": { + **CONFIG["rflink"], + CONF_RECONNECT_INTERVAL: 60, + }, + } + failures = [False, True] # Create platform and entities event_callback, _, _, disconnect_callback = await mock_rflink( hass, config, DOMAIN, monkeypatch, failures=failures ) + await hass.async_block_till_done() # Entities are unknown by default assert hass.states.get("binary_sensor.test").state == STATE_UNKNOWN diff --git a/tests/components/rflink/test_init.py b/tests/components/rflink/test_init.py index 736ad4c73cf..100ed07adf9 100644 --- a/tests/components/rflink/test_init.py +++ b/tests/components/rflink/test_init.py @@ -58,7 +58,7 @@ async def mock_rflink( # failures can be a list of booleans indicating in which sequence # creating a connection should success or fail if failures: - fail = failures.pop() + fail = failures.pop(0) # removes from left to right else: fail = False diff --git a/tests/components/rflink/test_sensor.py b/tests/components/rflink/test_sensor.py index 96204043298..05655cd52ae 100644 --- a/tests/components/rflink/test_sensor.py +++ b/tests/components/rflink/test_sensor.py @@ -131,23 +131,26 @@ async def test_disable_automatic_add( assert not hass.states.get("sensor.test2") -@pytest.mark.xfail( - reason="Flaky due to Python 3.14.3 asyncio changes - see home-assistant/core#162263" -) async def test_entity_availability( hass: HomeAssistant, monkeypatch: pytest.MonkeyPatch ) -> None: """If Rflink device is disconnected, entities should become unavailable.""" # Make sure Rflink mock does not 'recover' to quickly from the # disconnect or else the unavailability cannot be measured - config = CONFIG - failures = [True, True] - config[CONF_RECONNECT_INTERVAL] = 60 + config = { + **CONFIG, + "rflink": { + **CONFIG["rflink"], + CONF_RECONNECT_INTERVAL: 60, + }, + } + failures = [False, True] # Create platform and entities _, _, _, disconnect_callback = await mock_rflink( hass, config, DOMAIN, monkeypatch, failures=failures ) + await hass.async_block_till_done() # Entities are available by default assert hass.states.get("sensor.test").state == STATE_UNKNOWN