Skip to content

Commit

Permalink
Bump ruff to 0.6.0 (#123985)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Aug 16, 2024
1 parent c8b0c93 commit 06209dd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.0
hooks:
- id: ruff
args:
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/environment_canada/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Config flow for Environment Canada integration."""

import logging
import xml.etree.ElementTree as et
import xml.etree.ElementTree as ET

import aiohttp
from env_canada import ECWeather, ec_exc
Expand Down Expand Up @@ -52,7 +52,7 @@ async def async_step_user(self, user_input=None):
if user_input is not None:
try:
info = await validate_input(user_input)
except (et.ParseError, vol.MultipleInvalid, ec_exc.UnknownStationId):
except (ET.ParseError, vol.MultipleInvalid, ec_exc.UnknownStationId):
errors["base"] = "bad_station_id"
except aiohttp.ClientConnectionError:
errors["base"] = "cannot_connect"
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/environment_canada/coordinator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Coordinator for the Environment Canada (EC) component."""

import logging
import xml.etree.ElementTree as et
import xml.etree.ElementTree as ET

from env_canada import ec_exc

Expand All @@ -27,6 +27,6 @@ async def _async_update_data(self):
"""Fetch data from EC."""
try:
await self.ec_data.update()
except (et.ParseError, ec_exc.UnknownStationId) as ex:
except (ET.ParseError, ec_exc.UnknownStationId) as ex:
raise UpdateFailed(f"Error fetching {self.name} data: {ex}") from ex
return self.ec_data
2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit

codespell==2.3.0
ruff==0.5.7
ruff==0.6.0
yamllint==1.35.1
4 changes: 2 additions & 2 deletions tests/components/environment_canada/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the Environment Canada (EC) config flow."""

from unittest.mock import AsyncMock, MagicMock, Mock, patch
import xml.etree.ElementTree as et
import xml.etree.ElementTree as ET

import aiohttp
import pytest
Expand Down Expand Up @@ -94,7 +94,7 @@ async def test_create_same_entry_twice(hass: HomeAssistant) -> None:
(aiohttp.ClientResponseError(Mock(), (), status=404), "bad_station_id"),
(aiohttp.ClientResponseError(Mock(), (), status=400), "error_response"),
(aiohttp.ClientConnectionError, "cannot_connect"),
(et.ParseError, "bad_station_id"),
(ET.ParseError, "bad_station_id"),
(ValueError, "unknown"),
],
)
Expand Down
4 changes: 2 additions & 2 deletions tests/components/lg_netcast/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests for LG Netcast TV."""

from unittest.mock import patch
from xml.etree import ElementTree
import xml.etree.ElementTree as ET

from pylgnetcast import AccessTokenError, LgNetCastClient, SessionIdError
import requests
Expand Down Expand Up @@ -56,7 +56,7 @@ def _get_fake_query_device_info():
if always_404:
return None
if invalid_details:
raise ElementTree.ParseError("Mocked Parsed Error")
raise ET.ParseError("Mocked Parsed Error")
return {
"uuid": UNIQUE_ID if not no_unique_id else None,
"model_name": MODEL_NAME,
Expand Down

0 comments on commit 06209dd

Please sign in to comment.