@@ -91,6 +91,9 @@ async def test_parse_date_time(hass, caplog):
9191 spec , date_offset , expect = test_data
9292 out = TrigTime .parse_date_time (spec , date_offset , now , now )
9393 assert out == expect
94+ await Function .waiter_sync ()
95+ await Function .waiter_stop ()
96+ await Function .reaper_stop ()
9497
9598
9699parseDateTimeTestsDayNames = [
@@ -127,6 +130,9 @@ async def test_parse_date_time_day_names(hass, caplog):
127130 spec , date_offset , expect = test_data
128131 out = TrigTime .parse_date_time (spec , date_offset , now , now )
129132 assert out == expect
133+ await Function .waiter_sync ()
134+ await Function .waiter_stop ()
135+ await Function .reaper_stop ()
130136
131137
132138@pytest .mark .parametrize (
@@ -188,7 +194,8 @@ async def test_parse_date_time_day_names(hass, caplog):
188194 ],
189195 ids = lambda x : x if not isinstance (x , (dt , list )) else str (x ),
190196)
191- def test_timer_active_check (hass , spec , now , expected ):
197+ @pytest .mark .asyncio
198+ async def test_timer_active_check (hass , spec , now , expected ):
192199 """Run time active check tests."""
193200
194201 #
@@ -206,6 +213,9 @@ def test_timer_active_check(hass, spec, now, expected):
206213 print (f"calling timer_active_check({ spec } , { now } , { startup_time } )" )
207214 out = TrigTime .timer_active_check (spec , now , startup_time )
208215 assert out == expected
216+ await Function .waiter_sync ()
217+ await Function .waiter_stop ()
218+ await Function .reaper_stop ()
209219
210220
211221timerTriggerNextTests = [
@@ -450,7 +460,8 @@ def test_timer_active_check(hass, spec, now, expected):
450460]
451461
452462
453- def test_timer_trigger_next (hass ):
463+ @pytest .mark .asyncio
464+ async def test_timer_trigger_next (hass ):
454465 """Run trigger next tests."""
455466 #
456467 # Hardcode a location and timezone so we can check sunrise
@@ -474,6 +485,9 @@ def test_timer_trigger_next(hass):
474485 if t_next is None :
475486 break
476487 now = t_next + timedelta (microseconds = 1 )
488+ await Function .waiter_sync ()
489+ await Function .waiter_stop ()
490+ await Function .reaper_stop ()
477491
478492
479493timerTriggerNextTestsMonthRollover = [
@@ -571,7 +585,8 @@ def test_timer_trigger_next(hass):
571585]
572586
573587
574- def test_timer_trigger_next_month_rollover (hass ):
588+ @pytest .mark .asyncio
589+ async def test_timer_trigger_next_month_rollover (hass ):
575590 """Run month rollover tests."""
576591
577592 Function .init (hass )
@@ -584,3 +599,6 @@ def test_timer_trigger_next_month_rollover(hass):
584599 t_next = TrigTime .timer_trigger_next (spec , now , startup_time )
585600 assert t_next == expect
586601 now = t_next
602+ await Function .waiter_sync ()
603+ await Function .waiter_stop ()
604+ await Function .reaper_stop ()
0 commit comments