Fix ruff type comparison E721 (#120731)

Fix E721
This commit is contained in:
Joost Lekkerkerker
2024-06-28 11:56:49 +02:00
committed by GitHub
parent 3d580259e1
commit 0fdf037ba0
10 changed files with 19 additions and 19 deletions

View File

@@ -155,7 +155,7 @@ raise Exception('boom')
task = hass.async_add_executor_job(execute, hass, "test.py", source, {}, True)
await hass.async_block_till_done(wait_background_tasks=True)
assert type(task.exception()) == HomeAssistantError
assert type(task.exception()) is HomeAssistantError
assert "Error executing script (Exception): boom" in str(task.exception())
@@ -183,7 +183,7 @@ hass.async_stop()
task = hass.async_add_executor_job(execute, hass, "test.py", source, {}, True)
await hass.async_block_till_done(wait_background_tasks=True)
assert type(task.exception()) == ServiceValidationError
assert type(task.exception()) is ServiceValidationError
assert "Not allowed to access async methods" in str(task.exception())
@@ -233,7 +233,7 @@ async def test_accessing_forbidden_methods_with_response(hass: HomeAssistant) ->
task = hass.async_add_executor_job(execute, hass, "test.py", source, {}, True)
await hass.async_block_till_done(wait_background_tasks=True)
assert type(task.exception()) == ServiceValidationError
assert type(task.exception()) is ServiceValidationError
assert f"Not allowed to access {name}" in str(task.exception())