Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix additional test cases for Python 3.12 #101006

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/components/hassio/test_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ async def test_api_ingress_panels(
],
)
async def test_api_headers(
aiohttp_raw_server, # 'aiohttp_raw_server' must be before 'hass'!
emontnemery marked this conversation as resolved.
Show resolved Hide resolved
hass,
aiohttp_raw_server,
socket_enabled,
api_call: str,
method: Literal["GET", "POST"],
Expand Down
4 changes: 4 additions & 0 deletions tests/helpers/test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,7 @@ async def test_multiple_runs_wait(hass: HomeAssistant, action_type) -> None:
hass.states.async_set("switch.test", "on")
hass.async_create_task(script_obj.async_run(context=Context()))
await asyncio.wait_for(wait_started_flag.wait(), 1)
await asyncio.sleep(0)
emontnemery marked this conversation as resolved.
Show resolved Hide resolved

assert script_obj.is_running
assert len(events) == 1
Expand All @@ -1062,6 +1063,7 @@ async def test_multiple_runs_wait(hass: HomeAssistant, action_type) -> None:
wait_started_flag.clear()
hass.async_create_task(script_obj.async_run())
await asyncio.wait_for(wait_started_flag.wait(), 1)
await asyncio.sleep(0)
except (AssertionError, asyncio.TimeoutError):
await script_obj.async_stop()
raise
Expand Down Expand Up @@ -4079,6 +4081,7 @@ async def test_script_mode_2(
hass.states.async_set("switch.test", "on")
hass.async_create_task(script_obj.async_run(context=Context()))
await asyncio.wait_for(wait_started_flag.wait(), 1)
await asyncio.sleep(0)

assert script_obj.is_running
assert len(events) == 1
Expand All @@ -4089,6 +4092,7 @@ async def test_script_mode_2(
wait_started_flag.clear()
hass.async_create_task(script_obj.async_run(context=Context()))
await asyncio.wait_for(wait_started_flag.wait(), 1)
await asyncio.sleep(0)

assert script_obj.is_running
assert len(events) == 2
Expand Down