Fix additional test cases for Python 3.12 (#101006)
This commit is contained in:
parent
9fdc8494b6
commit
c59404b5bc
2 changed files with 5 additions and 1 deletions
|
@ -320,8 +320,8 @@ async def test_api_ingress_panels(
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
async def test_api_headers(
|
async def test_api_headers(
|
||||||
|
aiohttp_raw_server, # 'aiohttp_raw_server' must be before 'hass'!
|
||||||
hass,
|
hass,
|
||||||
aiohttp_raw_server,
|
|
||||||
socket_enabled,
|
socket_enabled,
|
||||||
api_call: str,
|
api_call: str,
|
||||||
method: Literal["GET", "POST"],
|
method: Literal["GET", "POST"],
|
||||||
|
|
|
@ -1053,6 +1053,7 @@ async def test_multiple_runs_wait(hass: HomeAssistant, action_type) -> None:
|
||||||
hass.states.async_set("switch.test", "on")
|
hass.states.async_set("switch.test", "on")
|
||||||
hass.async_create_task(script_obj.async_run(context=Context()))
|
hass.async_create_task(script_obj.async_run(context=Context()))
|
||||||
await asyncio.wait_for(wait_started_flag.wait(), 1)
|
await asyncio.wait_for(wait_started_flag.wait(), 1)
|
||||||
|
await asyncio.sleep(0)
|
||||||
|
|
||||||
assert script_obj.is_running
|
assert script_obj.is_running
|
||||||
assert len(events) == 1
|
assert len(events) == 1
|
||||||
|
@ -1062,6 +1063,7 @@ async def test_multiple_runs_wait(hass: HomeAssistant, action_type) -> None:
|
||||||
wait_started_flag.clear()
|
wait_started_flag.clear()
|
||||||
hass.async_create_task(script_obj.async_run())
|
hass.async_create_task(script_obj.async_run())
|
||||||
await asyncio.wait_for(wait_started_flag.wait(), 1)
|
await asyncio.wait_for(wait_started_flag.wait(), 1)
|
||||||
|
await asyncio.sleep(0)
|
||||||
except (AssertionError, asyncio.TimeoutError):
|
except (AssertionError, asyncio.TimeoutError):
|
||||||
await script_obj.async_stop()
|
await script_obj.async_stop()
|
||||||
raise
|
raise
|
||||||
|
@ -4079,6 +4081,7 @@ async def test_script_mode_2(
|
||||||
hass.states.async_set("switch.test", "on")
|
hass.states.async_set("switch.test", "on")
|
||||||
hass.async_create_task(script_obj.async_run(context=Context()))
|
hass.async_create_task(script_obj.async_run(context=Context()))
|
||||||
await asyncio.wait_for(wait_started_flag.wait(), 1)
|
await asyncio.wait_for(wait_started_flag.wait(), 1)
|
||||||
|
await asyncio.sleep(0)
|
||||||
|
|
||||||
assert script_obj.is_running
|
assert script_obj.is_running
|
||||||
assert len(events) == 1
|
assert len(events) == 1
|
||||||
|
@ -4089,6 +4092,7 @@ async def test_script_mode_2(
|
||||||
wait_started_flag.clear()
|
wait_started_flag.clear()
|
||||||
hass.async_create_task(script_obj.async_run(context=Context()))
|
hass.async_create_task(script_obj.async_run(context=Context()))
|
||||||
await asyncio.wait_for(wait_started_flag.wait(), 1)
|
await asyncio.wait_for(wait_started_flag.wait(), 1)
|
||||||
|
await asyncio.sleep(0)
|
||||||
|
|
||||||
assert script_obj.is_running
|
assert script_obj.is_running
|
||||||
assert len(events) == 2
|
assert len(events) == 2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue