Enable Ruff PT012 (#113957)
This commit is contained in:
parent
915658daa1
commit
721b2c2ca8
90 changed files with 341 additions and 429 deletions
|
@ -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 "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue