1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Add typing to tests with single hass argument (2) (#87675)

* Add typing to tests with single hass argument (2)

* a few more
This commit is contained in:
epenet
2023-02-08 08:51:43 +01:00
committed by GitHub
parent 1bbc03d0ba
commit c98b4e3204
50 changed files with 816 additions and 671 deletions

View File

@@ -3,14 +3,14 @@ from functools import partial
import pytest
from homeassistant.core import callback
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
async def test_simple_function(hass):
async def test_simple_function(hass: HomeAssistant) -> None:
"""Test simple function (executor)."""
calls = []
@@ -30,7 +30,7 @@ async def test_simple_function(hass):
assert calls == [3, "bla"]
async def test_simple_function_unsub(hass):
async def test_simple_function_unsub(hass: HomeAssistant) -> None:
"""Test simple function (executor) and unsub."""
calls1 = []
calls2 = []
@@ -72,7 +72,7 @@ async def test_simple_function_unsub(hass):
assert calls2 == [4]
async def test_simple_callback(hass):
async def test_simple_callback(hass: HomeAssistant) -> None:
"""Test simple callback (async)."""
calls = []
@@ -93,7 +93,7 @@ async def test_simple_callback(hass):
assert calls == [3, "bla"]
async def test_simple_coro(hass):
async def test_simple_coro(hass: HomeAssistant) -> None:
"""Test simple coro (async)."""
calls = []
@@ -113,7 +113,7 @@ async def test_simple_coro(hass):
assert calls == [3, "bla"]
async def test_simple_function_multiargs(hass):
async def test_simple_function_multiargs(hass: HomeAssistant) -> None:
"""Test simple function (executor)."""
calls = []