mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Ensure bluetooth auto recovery does not run in tests (#109163)
If time was moved forward too much the scanner would try to auto recover
This commit is contained in:
parent
4c6ac74313
commit
9c22226fed
@ -1576,9 +1576,10 @@ def mock_bleak_scanner_start() -> Generator[MagicMock, None, None]:
|
||||
# out start and this fixture will expire before the stop method is called
|
||||
# when EVENT_HOMEASSISTANT_STOP is fired.
|
||||
bluetooth_scanner.OriginalBleakScanner.stop = AsyncMock() # type: ignore[assignment]
|
||||
with patch(
|
||||
"habluetooth.scanner.OriginalBleakScanner.start",
|
||||
) as mock_bleak_scanner_start:
|
||||
with patch.object(
|
||||
bluetooth_scanner.OriginalBleakScanner,
|
||||
"start",
|
||||
) as mock_bleak_scanner_start, patch.object(bluetooth_scanner, "HaScanner"):
|
||||
yield mock_bleak_scanner_start
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user