Bump ruff to 0.6.0 (#123985)
parent
c8b0c939e4
commit
06209dd94c
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
@ -52,7 +52,7 @@ class EnvironmentCanadaConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
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"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -27,6 +27,6 @@ class ECDataUpdateCoordinator(DataUpdateCoordinator):
|
|||
"""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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -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"),
|
||||
],
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
@ -56,7 +56,7 @@ def _patched_lgnetcast_client(
|
|||
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,
|
||||
|
|
Loading…
Reference in New Issue