Merge multiple context managers in tests (#48146)

This commit is contained in:
Franck Nijhof
2021-03-27 09:17:15 +01:00
committed by GitHub
parent 79af18a8ab
commit ad13a9295e
33 changed files with 590 additions and 627 deletions

View File

@@ -1221,12 +1221,11 @@ async def test_init_custom_integration(hass):
None,
{"name": "Hue", "dependencies": [], "requirements": [], "domain": "hue"},
)
with pytest.raises(data_entry_flow.UnknownHandler):
with patch(
"homeassistant.loader.async_get_integration",
return_value=integration,
):
await hass.config_entries.flow.async_init("bla")
with pytest.raises(data_entry_flow.UnknownHandler), patch(
"homeassistant.loader.async_get_integration",
return_value=integration,
):
await hass.config_entries.flow.async_init("bla")
async def test_support_entry_unload(hass):