Fix group tests when run in parallel (#41446)

This commit is contained in:
J. Nick Koston 2020-10-08 00:01:33 -05:00 committed by GitHub
parent c1a0329401
commit 896f64d02b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -763,6 +763,7 @@ async def test_group_climate_all_cool(hass):
hass.states.async_set("climate.two", "cool") hass.states.async_set("climate.two", "cool")
hass.states.async_set("climate.three", "cool") hass.states.async_set("climate.three", "cool")
assert await async_setup_component(hass, "climate", {})
assert await async_setup_component( assert await async_setup_component(
hass, hass,
"group", "group",
@ -772,7 +773,6 @@ async def test_group_climate_all_cool(hass):
} }
}, },
) )
assert await async_setup_component(hass, "climate", {})
await hass.async_block_till_done() await hass.async_block_till_done()
assert hass.states.get("group.group_zero").state == STATE_ON assert hass.states.get("group.group_zero").state == STATE_ON
@ -1041,6 +1041,7 @@ async def test_cover_added_after_group(hass):
"cover.downstairs", "cover.downstairs",
] ]
assert await async_setup_component(hass, "cover", {})
assert await async_setup_component( assert await async_setup_component(
hass, hass,
"group", "group",
@ -1125,6 +1126,8 @@ async def test_group_that_references_a_group_of_covers(hass):
} }
}, },
) )
assert await async_setup_component(hass, "cover", {})
await hass.async_block_till_done() await hass.async_block_till_done()
hass.bus.async_fire(EVENT_HOMEASSISTANT_START) hass.bus.async_fire(EVENT_HOMEASSISTANT_START)
@ -1147,6 +1150,7 @@ async def test_group_that_references_two_groups_of_covers(hass):
hass.states.async_set(entity_id, "closed") hass.states.async_set(entity_id, "closed")
await hass.async_block_till_done() await hass.async_block_till_done()
assert await async_setup_component(hass, "cover", {})
assert await async_setup_component( assert await async_setup_component(
hass, hass,
"group", "group",
@ -1192,6 +1196,7 @@ async def test_group_that_references_two_types_of_groups(hass):
hass.states.async_set(entity_id, "home") hass.states.async_set(entity_id, "home")
await hass.async_block_till_done() await hass.async_block_till_done()
assert await async_setup_component(hass, "device_tracker", {})
assert await async_setup_component( assert await async_setup_component(
hass, hass,
"group", "group",
@ -1205,6 +1210,7 @@ async def test_group_that_references_two_types_of_groups(hass):
} }
}, },
) )
assert await async_setup_component(hass, "cover", {})
await hass.async_block_till_done() await hass.async_block_till_done()
hass.bus.async_fire(EVENT_HOMEASSISTANT_START) hass.bus.async_fire(EVENT_HOMEASSISTANT_START)