Unignore Ruff E731 (#115564)

This commit is contained in:
Sid 2024-04-14 07:15:10 +02:00 committed by GitHub
parent 3799d20d43
commit c24ae01a43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 14 deletions

View file

@ -125,11 +125,9 @@ class Fan(HomeAccessory):
),
)
setter_callback = (
lambda value, preset_mode=preset_mode: self.set_preset_mode(
value, preset_mode
)
)
def setter_callback(value: int, preset_mode: str = preset_mode) -> None:
return self.set_preset_mode(value, preset_mode)
self.preset_mode_chars[preset_mode] = preset_serv.configure_char(
CHAR_ON,
value=False,

View file

@ -739,7 +739,6 @@ ignore = [
"D406", # Section name should end with a newline
"D407", # Section name underlining
"E501", # line too long
"E731", # do not assign a lambda expression, use a def
"PLC1901", # {existing} can be simplified to {replacement} as an empty string is falsey; too many false positives
"PLR0911", # Too many return statements ({returns} > {max_returns})

View file

@ -89,9 +89,9 @@ TEST_MIGRATING_ENTITIES = [
),
]
MIGRATION_CONNECT = lambda *args, **kwargs: stub_async_connect(
DATA_MIN_MIGRATION, *args, **kwargs
)
def _migration_connect(*args, **kwargs):
return stub_async_connect(DATA_MIN_MIGRATION, *args, **kwargs)
@pytest.mark.parametrize(
@ -164,7 +164,7 @@ async def test_async_migrate_entries(
),
patch.multiple(
ScreenLogicGateway,
async_connect=MIGRATION_CONNECT,
async_connect=_migration_connect,
is_connected=True,
_async_connected_request=DEFAULT,
),
@ -236,7 +236,7 @@ async def test_entity_migration_data(
),
patch.multiple(
ScreenLogicGateway,
async_connect=MIGRATION_CONNECT,
async_connect=_migration_connect,
is_connected=True,
_async_connected_request=DEFAULT,
),
@ -257,9 +257,9 @@ async def test_platform_setup(
hass: HomeAssistant, mock_config_entry: MockConfigEntry
) -> None:
"""Test setup for platforms that define expected data."""
stub_connect = lambda *args, **kwargs: stub_async_connect(
DATA_MISSING_VALUES_CHEM_CHLOR, *args, **kwargs
)
def stub_connect(*args, **kwargs):
return stub_async_connect(DATA_MISSING_VALUES_CHEM_CHLOR, *args, **kwargs)
device_prefix = slugify(MOCK_ADAPTER_NAME)