Move fixtures to decorators in core tests (#119675)

This commit is contained in:
epenet 2024-06-14 13:32:42 +02:00 committed by GitHub
parent b80f7185b2
commit 01be5d5f6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 80 additions and 109 deletions

View file

@ -1177,19 +1177,17 @@ async def test_loading_component_loads_translations(hass: HomeAssistant) -> None
assert translation.async_translations_loaded(hass, {"comp"}) is True
async def test_importing_integration_in_executor(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:
@pytest.mark.usefixtures("enable_custom_integrations")
async def test_importing_integration_in_executor(hass: HomeAssistant) -> None:
"""Test we can import an integration in an executor."""
assert await setup.async_setup_component(hass, "test_package_loaded_executor", {})
assert await setup.async_setup_component(hass, "test_package_loaded_executor", {})
await hass.async_block_till_done()
@pytest.mark.usefixtures("enable_custom_integrations")
async def test_async_prepare_setup_platform(
hass: HomeAssistant,
enable_custom_integrations: None,
caplog: pytest.LogCaptureFixture,
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
"""Test we can prepare a platform setup."""
integration = await loader.async_get_integration(hass, "test")