Skip to content

Commit 5c79bf7

Browse files
committed
add reaper_stop to test_service_call_params so that tests don't break
1 parent 44c1129 commit 5c79bf7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_function.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,10 +809,10 @@ def set_add(entity_id=None, val1=None, val2=None):
809809

810810
async def test_service_call_params(hass):
811811
"""Test that hass params get set properly on service calls."""
812-
Function.init(hass)
813-
with patch.object(Function.hass.services, "async_call") as call, patch.object(
812+
with patch.object(hass.services, "async_call") as call, patch.object(
814813
Function, "service_has_service", return_value=True
815814
):
815+
Function.init(hass)
816816
await Function.service_call(
817817
"test", "test", context=Context(id="test"), blocking=True, limit=1, other_service_data="test"
818818
)
@@ -843,3 +843,6 @@ async def test_service_call_params(hass):
843843
assert call.called
844844
assert call.call_args[0] == ("test", "test", {"other_service_data": "test"})
845845
assert call.call_args[1] == {"context": Context(id="test"), "blocking": False}
846+
847+
# Stop all tasks to avoid conflicts with other tests
848+
await Function.reaper_stop()

0 commit comments

Comments
 (0)