mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 21:40:16 +00:00
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
committed by
GitHub
parent
27219b6962
commit
6bb4e7d62c
@@ -64,14 +64,17 @@ async def test_system_status_subscription(
|
||||
VirtualMem = namedtuple("VirtualMemory", ["available", "percent", "total"])
|
||||
vmem = VirtualMem(10 * 1024**2, 50, 30 * 1024**2)
|
||||
|
||||
with patch.object(
|
||||
mock_psutil.psutil,
|
||||
"cpu_percent",
|
||||
return_value=123,
|
||||
), patch.object(
|
||||
mock_psutil.psutil,
|
||||
"virtual_memory",
|
||||
return_value=vmem,
|
||||
with (
|
||||
patch.object(
|
||||
mock_psutil.psutil,
|
||||
"cpu_percent",
|
||||
return_value=123,
|
||||
),
|
||||
patch.object(
|
||||
mock_psutil.psutil,
|
||||
"virtual_memory",
|
||||
return_value=vmem,
|
||||
),
|
||||
):
|
||||
freezer.tick(TEST_TIME_ADVANCE_INTERVAL)
|
||||
await hass.async_block_till_done()
|
||||
@@ -91,9 +94,10 @@ async def test_system_status_subscription(
|
||||
response = await client.receive_json()
|
||||
assert response["success"]
|
||||
|
||||
with patch.object(mock_psutil.psutil, "cpu_percent") as cpu_mock, patch.object(
|
||||
mock_psutil.psutil, "virtual_memory"
|
||||
) as vmem_mock:
|
||||
with (
|
||||
patch.object(mock_psutil.psutil, "cpu_percent") as cpu_mock,
|
||||
patch.object(mock_psutil.psutil, "virtual_memory") as vmem_mock,
|
||||
):
|
||||
freezer.tick(TEST_TIME_ADVANCE_INTERVAL)
|
||||
await hass.async_block_till_done()
|
||||
cpu_mock.assert_not_called()
|
||||
|
||||
Reference in New Issue
Block a user