diff --git a/src/easyenergy/const.py b/src/easyenergy/const.py index 92cda7b..910aeab 100644 --- a/src/easyenergy/const.py +++ b/src/easyenergy/const.py @@ -1,4 +1,5 @@ """Constants for EasyEnergy API client.""" + from __future__ import annotations from enum import Enum diff --git a/src/easyenergy/easyenergy.py b/src/easyenergy/easyenergy.py index 7ea213e..336cdbb 100644 --- a/src/easyenergy/easyenergy.py +++ b/src/easyenergy/easyenergy.py @@ -1,4 +1,5 @@ """Asynchronous Python client for the easyEnergy API.""" + from __future__ import annotations import asyncio diff --git a/src/easyenergy/models.py b/src/easyenergy/models.py index 2dff05b..9d57e0b 100644 --- a/src/easyenergy/models.py +++ b/src/easyenergy/models.py @@ -1,4 +1,5 @@ """Data models for the easyEnergy API.""" + from __future__ import annotations from dataclasses import dataclass diff --git a/tests/__init__.py b/tests/__init__.py index 4b4f722..22542ca 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,5 @@ """Asynchronous Python client for the easyEnergy API.""" + from pathlib import Path diff --git a/tests/test_easyenergy.py b/tests/test_easyenergy.py index 99bce88..9877ea6 100644 --- a/tests/test_easyenergy.py +++ b/tests/test_easyenergy.py @@ -1,4 +1,5 @@ """Basic tests for the easyEnergy API.""" + # pylint: disable=protected-access import asyncio from typing import Any @@ -91,11 +92,14 @@ async def test_client_error() -> None: """Test request client error is handled correctly.""" async with ClientSession() as session: client = EasyEnergy(session=session) - with patch.object( - session, - "request", - side_effect=ClientError, - ), pytest.raises(EasyEnergyConnectionError): + with ( + patch.object( + session, + "request", + side_effect=ClientError, + ), + pytest.raises(EasyEnergyConnectionError), + ): assert await client._request("test") @@ -103,11 +107,14 @@ async def test_dns_error() -> None: """Test request DNS error is handled correctly.""" async with ClientSession() as session: client = EasyEnergy(session=session) - with patch.object( - DNSResolver, - "query", - side_effect=DNSError, - ), pytest.raises(EasyEnergyConnectionError): + with ( + patch.object( + DNSResolver, + "query", + side_effect=DNSError, + ), + pytest.raises(EasyEnergyConnectionError), + ): assert await client._request("test") @@ -117,9 +124,12 @@ async def test_empty_dns_error() -> None: client = EasyEnergy(session=session) dns_result: Any = asyncio.Future() dns_result.set_result(None) - with patch.object( - DNSResolver, - "query", - return_value=dns_result, - ), pytest.raises(EasyEnergyConnectionError): + with ( + patch.object( + DNSResolver, + "query", + return_value=dns_result, + ), + pytest.raises(EasyEnergyConnectionError), + ): assert await client._request("test") diff --git a/tests/test_models.py b/tests/test_models.py index 07f2aba..3e48722 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,4 +1,5 @@ """Test the models.""" + from datetime import UTC, date, datetime import pytest