mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Ignore c-extension-no-member pylint warnings in tests (#119378)
This commit is contained in:
parent
18f30d2ee9
commit
572700a326
@ -129,7 +129,7 @@ async def test_setup_and_stop_passive(
|
|||||||
|
|
||||||
assert init_kwargs == {
|
assert init_kwargs == {
|
||||||
"adapter": "hci0",
|
"adapter": "hci0",
|
||||||
"bluez": scanner.PASSIVE_SCANNER_ARGS,
|
"bluez": scanner.PASSIVE_SCANNER_ARGS, # pylint: disable=c-extension-no-member
|
||||||
"scanning_mode": "passive",
|
"scanning_mode": "passive",
|
||||||
"detection_callback": ANY,
|
"detection_callback": ANY,
|
||||||
}
|
}
|
||||||
|
@ -309,6 +309,7 @@ async def test_stream_retries(
|
|||||||
|
|
||||||
def av_open_side_effect(*args, **kwargs):
|
def av_open_side_effect(*args, **kwargs):
|
||||||
hass.loop.call_soon_threadsafe(futures.pop().set_result, None)
|
hass.loop.call_soon_threadsafe(futures.pop().set_result, None)
|
||||||
|
# pylint: disable-next=c-extension-no-member
|
||||||
raise av.error.InvalidDataError(-2, "error")
|
raise av.error.InvalidDataError(-2, "error")
|
||||||
|
|
||||||
with (
|
with (
|
||||||
|
@ -342,6 +342,7 @@ async def test_stream_open_fails(hass: HomeAssistant) -> None:
|
|||||||
)
|
)
|
||||||
stream.add_provider(HLS_PROVIDER)
|
stream.add_provider(HLS_PROVIDER)
|
||||||
with patch("av.open") as av_open:
|
with patch("av.open") as av_open:
|
||||||
|
# pylint: disable-next=c-extension-no-member
|
||||||
av_open.side_effect = av.error.InvalidDataError(-2, "error")
|
av_open.side_effect = av.error.InvalidDataError(-2, "error")
|
||||||
with pytest.raises(StreamWorkerError):
|
with pytest.raises(StreamWorkerError):
|
||||||
run_worker(hass, stream, STREAM_SOURCE)
|
run_worker(hass, stream, STREAM_SOURCE)
|
||||||
@ -770,6 +771,7 @@ async def test_worker_log(
|
|||||||
stream.add_provider(HLS_PROVIDER)
|
stream.add_provider(HLS_PROVIDER)
|
||||||
|
|
||||||
with patch("av.open") as av_open:
|
with patch("av.open") as av_open:
|
||||||
|
# pylint: disable-next=c-extension-no-member
|
||||||
av_open.side_effect = av.error.InvalidDataError(-2, "error")
|
av_open.side_effect = av.error.InvalidDataError(-2, "error")
|
||||||
with pytest.raises(StreamWorkerError) as err:
|
with pytest.raises(StreamWorkerError) as err:
|
||||||
run_worker(hass, stream, stream_url)
|
run_worker(hass, stream, stream_url)
|
||||||
|
@ -1686,10 +1686,11 @@ def mock_bleak_scanner_start() -> Generator[MagicMock]:
|
|||||||
# We need to drop the stop method from the object since we patched
|
# We need to drop the stop method from the object since we patched
|
||||||
# out start and this fixture will expire before the stop method is called
|
# out start and this fixture will expire before the stop method is called
|
||||||
# when EVENT_HOMEASSISTANT_STOP is fired.
|
# when EVENT_HOMEASSISTANT_STOP is fired.
|
||||||
|
# pylint: disable-next=c-extension-no-member
|
||||||
bluetooth_scanner.OriginalBleakScanner.stop = AsyncMock() # type: ignore[assignment]
|
bluetooth_scanner.OriginalBleakScanner.stop = AsyncMock() # type: ignore[assignment]
|
||||||
with (
|
with (
|
||||||
patch.object(
|
patch.object(
|
||||||
bluetooth_scanner.OriginalBleakScanner,
|
bluetooth_scanner.OriginalBleakScanner, # pylint: disable=c-extension-no-member
|
||||||
"start",
|
"start",
|
||||||
) as mock_bleak_scanner_start,
|
) as mock_bleak_scanner_start,
|
||||||
patch.object(bluetooth_scanner, "HaScanner"),
|
patch.object(bluetooth_scanner, "HaScanner"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user