Fix unnecessary-dunder-call pylint warnings in tests (#119379)

This commit is contained in:
epenet 2024-06-11 16:18:16 +02:00 committed by GitHub
parent bdf69c2e5b
commit ea571a6997
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 1 deletions

View File

@ -1680,7 +1680,7 @@ def import_and_test_deprecated_alias(
def help_test_all(module: ModuleType) -> None:
"""Test module.__all__ is correctly set."""
assert set(module.__all__) == {
itm for itm in module.__dir__() if not itm.startswith("_")
itm for itm in dir(module) if not itm.startswith("_")
}

View File

@ -149,6 +149,7 @@ async def test_send_text_command(
mock_text_assistant.assert_called_once_with(
ExpectedCredentials(), expected_language_code, audio_out=False
)
# pylint:disable-next=unnecessary-dunder-call
mock_text_assistant.assert_has_calls([call().__enter__().assist(command)])

View File

@ -50,6 +50,7 @@ async def test_broadcast_no_targets(
mock_text_assistant.assert_called_once_with(
ExpectedCredentials(), language_code, audio_out=False
)
# pylint:disable-next=unnecessary-dunder-call
mock_text_assistant.assert_has_calls([call().__enter__().assist(expected_command)])

View File

@ -108,6 +108,7 @@ async def test_observer_discovery(
hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP)
await hass.async_block_till_done()
# pylint:disable-next=unnecessary-dunder-call
assert mock_observer.mock_calls == [call.start(), call.__bool__(), call.stop()]