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

Enable Ruff PT012 (#113957)

This commit is contained in:
Sid
2024-06-08 17:59:08 +02:00
committed by GitHub
parent 915658daa1
commit 721b2c2ca8
90 changed files with 341 additions and 429 deletions

View File

@@ -113,7 +113,6 @@ async def test_protect_loop_importlib_import_module_non_integration(
]
)
with (
pytest.raises(ImportError),
patch.object(block_async_io, "_IN_TESTS", False),
patch(
"homeassistant.block_async_io.get_current_frame",
@@ -125,7 +124,8 @@ async def test_protect_loop_importlib_import_module_non_integration(
),
):
block_async_io.enable()
importlib.import_module("not_loaded_module")
with pytest.raises(ImportError):
importlib.import_module("not_loaded_module")
assert "Detected blocking call to import_module" in caplog.text
@@ -184,7 +184,6 @@ async def test_protect_loop_importlib_import_module_in_integration(
]
)
with (
pytest.raises(ImportError),
patch.object(block_async_io, "_IN_TESTS", False),
patch(
"homeassistant.block_async_io.get_current_frame",
@@ -196,7 +195,8 @@ async def test_protect_loop_importlib_import_module_in_integration(
),
):
block_async_io.enable()
importlib.import_module("not_loaded_module")
with pytest.raises(ImportError):
importlib.import_module("not_loaded_module")
assert (
"Detected blocking call to import_module inside the event loop by "