Add more type hints to conftest.py (#87842)

* Add more type hints in conftest.py

* Adjust stop_hass

* Adjust mock_integration_frame

* Adjust pylint plugin
This commit is contained in:
epenet
2023-02-11 13:48:53 +01:00
committed by GitHub
parent 6d87ebc7de
commit b7b82b1e3f
6 changed files with 64 additions and 31 deletions

View File

@@ -96,16 +96,36 @@ _TEST_FIXTURES: dict[str, list[str] | str] = {
"area_registry": "AreaRegistry",
"async_setup_recorder_instance": "RecorderInstanceGenerator",
"caplog": "pytest.LogCaptureFixture",
"current_request_with_host": "None",
"device_registry": "DeviceRegistry",
"enable_bluetooth": "None",
"enable_custom_integrations": "None",
"enable_nightly_purge": "bool",
"enable_statistics": "bool",
"enable_statistics_table_validation": "bool",
"entity_registry": "EntityRegistry",
"hass_access_token": "str",
"hass_admin_credential": "Credentials",
"hass_admin_user": "MockUser",
"hass_client": "ClientSessionGenerator",
"hass_client_no_auth": "ClientSessionGenerator",
"hass_owner_user": "MockUser",
"hass_read_only_access_token": "str",
"hass_read_only_user": "MockUser",
"hass_recorder": "Callable[..., HomeAssistant]",
"hass_supervisor_access_token": "str",
"hass_supervisor_user": "MockUser",
"hass_ws_client": "WebSocketGenerator",
"issue_registry": "IssueRegistry",
"legacy_auth": "LegacyApiPasswordAuthProvider",
"local_auth": "HassAuthProvider",
"mock_async_zeroconf": "None",
"mock_bleak_scanner_start": "MagicMock",
"mock_bluetooth": "None",
"mock_bluetooth_adapters": "None",
"mock_device_tracker_conf": "list[Device]",
"mock_get_source_ip": "None",
"mock_zeroconf": "None",
"mqtt_client_mock": "MqttMockPahoClient",
"mqtt_mock": "MqttMockHAClient",
"mqtt_mock_entry_no_yaml_config": "MqttMockHAClientGenerator",
@@ -113,6 +133,7 @@ _TEST_FIXTURES: dict[str, list[str] | str] = {
"recorder_db_url": "str",
"recorder_mock": "Recorder",
"requests_mock": "requests_mock.Mocker",
"tmp_path": "Path",
}
_TEST_FUNCTION_MATCH = TypeHintMatch(
function_name="test_*",