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
1 changed files with 4 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue