Ignore c-extension-no-member pylint warnings in tests (#119378)

pull/119392/head
epenet 2024-06-11 12:57:43 +02:00 committed by GitHub
parent 18f30d2ee9
commit 572700a326
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 2 deletions

View File

@ -129,7 +129,7 @@ async def test_setup_and_stop_passive(
assert init_kwargs == {
"adapter": "hci0",
"bluez": scanner.PASSIVE_SCANNER_ARGS,
"bluez": scanner.PASSIVE_SCANNER_ARGS, # pylint: disable=c-extension-no-member
"scanning_mode": "passive",
"detection_callback": ANY,
}

View File

@ -309,6 +309,7 @@ async def test_stream_retries(
def av_open_side_effect(*args, **kwargs):
hass.loop.call_soon_threadsafe(futures.pop().set_result, None)
# pylint: disable-next=c-extension-no-member
raise av.error.InvalidDataError(-2, "error")
with (

View File

@ -342,6 +342,7 @@ async def test_stream_open_fails(hass: HomeAssistant) -> None:
)
stream.add_provider(HLS_PROVIDER)
with patch("av.open") as av_open:
# pylint: disable-next=c-extension-no-member
av_open.side_effect = av.error.InvalidDataError(-2, "error")
with pytest.raises(StreamWorkerError):
run_worker(hass, stream, STREAM_SOURCE)
@ -770,6 +771,7 @@ async def test_worker_log(
stream.add_provider(HLS_PROVIDER)
with patch("av.open") as av_open:
# pylint: disable-next=c-extension-no-member
av_open.side_effect = av.error.InvalidDataError(-2, "error")
with pytest.raises(StreamWorkerError) as err:
run_worker(hass, stream, stream_url)

View File

@ -1686,10 +1686,11 @@ def mock_bleak_scanner_start() -> Generator[MagicMock]:
# 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
# when EVENT_HOMEASSISTANT_STOP is fired.
# pylint: disable-next=c-extension-no-member
bluetooth_scanner.OriginalBleakScanner.stop = AsyncMock() # type: ignore[assignment]
with (
patch.object(
bluetooth_scanner.OriginalBleakScanner,
bluetooth_scanner.OriginalBleakScanner, # pylint: disable=c-extension-no-member
"start",
) as mock_bleak_scanner_start,
patch.object(bluetooth_scanner, "HaScanner"),