Remove unused caplog fixtures in tests (#119056)

This commit is contained in:
epenet 2024-06-07 11:38:56 +02:00 committed by GitHub
parent b3a71dcea3
commit 1c8a9cc3b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 21 deletions

View file

@ -2940,9 +2940,7 @@ def test_deprecated_constants(
)
async def test_automation_turns_off_other_automation(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
async def test_automation_turns_off_other_automation(hass: HomeAssistant) -> None:
"""Test an automation that turns off another automation."""
hass.set_state(CoreState.not_running)
calls = async_mock_service(hass, "persistent_notification", "create")
@ -3021,7 +3019,7 @@ async def test_automation_turns_off_other_automation(
async def test_two_automations_call_restart_script_same_time(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
hass: HomeAssistant,
) -> None:
"""Test two automations that call a restart mode script at the same."""
hass.states.async_set("binary_sensor.presence", "off")

View file

@ -38,7 +38,6 @@ async def test_setup_entry_device_update(
mock_ring_devices,
freezer: FrozenDateTimeFactory,
mock_added_config_entry: MockConfigEntry,
caplog,
) -> None:
"""Test devices are updating after setup entry."""

View file

@ -43,7 +43,7 @@ async def test_protect_loop_debugger_sleep(caplog: pytest.LogCaptureFixture) ->
assert "Detected blocking call inside the event loop" not in caplog.text
async def test_protect_loop_sleep(caplog: pytest.LogCaptureFixture) -> None:
async def test_protect_loop_sleep() -> None:
"""Test time.sleep not injected by the debugger raises."""
block_async_io.enable()
frames = extract_stack_to_frame(
@ -71,9 +71,7 @@ async def test_protect_loop_sleep(caplog: pytest.LogCaptureFixture) -> None:
time.sleep(0)
async def test_protect_loop_sleep_get_current_frame_raises(
caplog: pytest.LogCaptureFixture,
) -> None:
async def test_protect_loop_sleep_get_current_frame_raises() -> None:
"""Test time.sleep when get_current_frame raises ValueError."""
block_async_io.enable()
frames = extract_stack_to_frame(

View file

@ -1171,9 +1171,7 @@ async def test_bootstrap_is_cancellation_safe(
@pytest.mark.parametrize("load_registries", [False])
async def test_bootstrap_empty_integrations(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
async def test_bootstrap_empty_integrations(hass: HomeAssistant) -> None:
"""Test setting up an empty integrations does not raise."""
await bootstrap.async_setup_multi_components(hass, set(), {})
await hass.async_block_till_done()

View file

@ -1034,9 +1034,7 @@ async def test_get_custom_components_recovery_mode(hass: HomeAssistant) -> None:
assert await loader.async_get_custom_components(hass) == {}
async def test_custom_integration_missing_version(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
async def test_custom_integration_missing_version(hass: HomeAssistant) -> None:
"""Test trying to load a custom integration without a version twice does not deadlock."""
with pytest.raises(loader.IntegrationNotFound):
await loader.async_get_integration(hass, "test_no_version")
@ -1045,9 +1043,7 @@ async def test_custom_integration_missing_version(
await loader.async_get_integration(hass, "test_no_version")
async def test_custom_integration_missing(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
async def test_custom_integration_missing(hass: HomeAssistant) -> None:
"""Test trying to load a custom integration that is missing twice not deadlock."""
with patch("homeassistant.loader.async_get_custom_components") as mock_get:
mock_get.return_value = {}
@ -1296,7 +1292,7 @@ async def test_hass_components_use_reported(
async def test_async_get_component_preloads_config_and_config_flow(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
hass: HomeAssistant,
) -> None:
"""Verify async_get_component will try to preload the config and config_flow platform."""
executor_import_integration = _get_test_integration(
@ -1407,7 +1403,6 @@ async def test_async_get_component_loads_loop_if_already_in_sys_modules(
async def test_async_get_component_concurrent_loads(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
enable_custom_integrations: None,
) -> None:
"""Verify async_get_component waits if the first load if called again when still in progress."""
@ -1882,7 +1877,6 @@ async def test_async_get_platforms_loads_loop_if_already_in_sys_modules(
async def test_async_get_platforms_concurrent_loads(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
enable_custom_integrations: None,
) -> None:
"""Verify async_get_platforms waits if the first load if called again.