mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Fix modbus test assuming repeat listeners always fire at 0 microseconds (#82320)
This commit is contained in:
parent
dd960c4e62
commit
077bd594eb
@ -733,7 +733,10 @@ async def test_delay(hass, mock_pymodbus):
|
||||
time_stop = time_after_scan + timedelta(seconds=10)
|
||||
now = start_time
|
||||
while now < time_stop:
|
||||
now += timedelta(seconds=1)
|
||||
# This test assumed listeners are always fired at 0
|
||||
# microseconds which is impossible in production so
|
||||
# we use 999999 microseconds to simulate the real world.
|
||||
now += timedelta(seconds=1, microseconds=999999)
|
||||
with mock.patch(
|
||||
"homeassistant.helpers.event.dt_util.utcnow",
|
||||
return_value=now,
|
||||
|
Loading…
x
Reference in New Issue
Block a user