@@ -90,7 +90,7 @@ def test_restore_reenables_disabled(monkeypatch):
9090 migration = _install_er (monkeypatch , reg , entries )
9191
9292 import asyncio
93- n = asyncio .get_event_loop (). run_until_complete (
93+ n = asyncio .run (
9494 migration .async_restore_entities (MagicMock (), _Entry (), ["disabled:sensor.b" ]))
9595 assert n == 1
9696 assert reg .async_get ("sensor.b" ).disabled_by is None
@@ -102,7 +102,7 @@ def test_restore_purges_deleted(monkeypatch):
102102 migration = _install_er (monkeypatch , reg , [])
103103
104104 import asyncio
105- n = asyncio .get_event_loop (). run_until_complete (
105+ n = asyncio .run (
106106 migration .async_restore_entities (MagicMock (), _Entry (), ["deleted:sensor.gone" ]))
107107 assert n == 1
108108 assert "sensor.gone" not in reg .deleted_entities # record cleared
@@ -113,7 +113,7 @@ def test_restore_ignores_unknown_keys(monkeypatch):
113113 reg = _FakeRegistry ([], {})
114114 migration = _install_er (monkeypatch , reg , [])
115115 import asyncio
116- n = asyncio .get_event_loop (). run_until_complete (
116+ n = asyncio .run (
117117 migration .async_restore_entities (MagicMock (), _Entry (),
118118 ["deleted:sensor.nope" , "bogus" , "disabled:" ]))
119119 assert n == 0
0 commit comments