Move enable_custom_integrations fixture to decorator (#118844)
This commit is contained in:
parent
985e42e50c
commit
c7e065c413
32 changed files with 112 additions and 121 deletions
|
@ -55,12 +55,11 @@ async def test_button(hass: HomeAssistant) -> None:
|
|||
assert button.press.called
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("enable_custom_integrations", "setup_platform")
|
||||
async def test_custom_integration(
|
||||
hass: HomeAssistant,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
enable_custom_integrations: None,
|
||||
freezer: FrozenDateTimeFactory,
|
||||
setup_platform: None,
|
||||
) -> None:
|
||||
"""Test we integration."""
|
||||
assert await async_setup_component(hass, DOMAIN, {DOMAIN: {CONF_PLATFORM: "test"}})
|
||||
|
@ -95,9 +94,8 @@ async def test_custom_integration(
|
|||
assert hass.states.get("button.button_1").state == new_time_isoformat
|
||||
|
||||
|
||||
async def test_restore_state(
|
||||
hass: HomeAssistant, enable_custom_integrations: None, setup_platform: None
|
||||
) -> None:
|
||||
@pytest.mark.usefixtures("enable_custom_integrations", "setup_platform")
|
||||
async def test_restore_state(hass: HomeAssistant) -> None:
|
||||
"""Test we restore state integration."""
|
||||
mock_restore_cache(hass, (State("button.button_1", "2021-01-01T23:59:59+00:00"),))
|
||||
|
||||
|
@ -107,9 +105,8 @@ async def test_restore_state(
|
|||
assert hass.states.get("button.button_1").state == "2021-01-01T23:59:59+00:00"
|
||||
|
||||
|
||||
async def test_restore_state_does_not_restore_unavailable(
|
||||
hass: HomeAssistant, enable_custom_integrations: None, setup_platform: None
|
||||
) -> None:
|
||||
@pytest.mark.usefixtures("enable_custom_integrations", "setup_platform")
|
||||
async def test_restore_state_does_not_restore_unavailable(hass: HomeAssistant) -> None:
|
||||
"""Test we restore state integration except for unavailable."""
|
||||
mock_restore_cache(hass, (State("button.button_1", STATE_UNAVAILABLE),))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue