diff --git a/pyproject.toml b/pyproject.toml index 0d8e727b2f5..47127052375 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -267,7 +267,6 @@ ignore = [ "E501", # line too long "E713", # Test for membership should be 'not in' "E731", # do not assign a lambda expression, use a def - "UP024", # Replace aliased errors with `OSError` ] [tool.ruff.flake8-pytest-style] diff --git a/tests/components/influxdb/test_init.py b/tests/components/influxdb/test_init.py index 3ea9fd35d0d..cd3bd283e2b 100644 --- a/tests/components/influxdb/test_init.py +++ b/tests/components/influxdb/test_init.py @@ -1457,7 +1457,7 @@ async def test_event_listener_scheduled_write( ) event = MagicMock(data={"new_state": state}, time_fired=12345) write_api = get_write_api(mock_client) - write_api.side_effect = IOError("foo") + write_api.side_effect = OSError("foo") # Write fails with patch.object(influxdb.time, "sleep") as mock_sleep: diff --git a/tests/components/synology_dsm/test_config_flow.py b/tests/components/synology_dsm/test_config_flow.py index 402dcd2f602..6ce4851fb09 100644 --- a/tests/components/synology_dsm/test_config_flow.py +++ b/tests/components/synology_dsm/test_config_flow.py @@ -412,7 +412,7 @@ async def test_login_failed(hass: HomeAssistant, service: MagicMock): async def test_connection_failed(hass: HomeAssistant, service: MagicMock): """Test when we have errors during connection.""" service.return_value.login = Mock( - side_effect=SynologyDSMRequestException(IOError("arg")) + side_effect=SynologyDSMRequestException(OSError("arg")) ) result = await hass.config_entries.flow.async_init(