diff --git a/devolo_home_control_api/publisher/publisher.py b/devolo_home_control_api/publisher/publisher.py index 490f39d..ef3f745 100644 --- a/devolo_home_control_api/publisher/publisher.py +++ b/devolo_home_control_api/publisher/publisher.py @@ -2,7 +2,8 @@ from __future__ import annotations import logging -from typing import Any, Callable, KeysView +from collections.abc import KeysView +from typing import Any, Callable class Publisher: diff --git a/pyproject.toml b/pyproject.toml index e9a1d47..e11886c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ ignore_missing_imports = true line-length = 127 lint.ignore = ["ANN401", "B024", "COM812", "D203", "D205", "D212", "EM", "FBT001", "N818", "TCH", "TRY300", "TRY400"] lint.select = ["ALL"] -target-version = "py37" +target-version = "py39" [tool.ruff.lint.isort] combine-as-imports = true diff --git a/tests/__init__.py b/tests/__init__.py index 85e1387..b8f660b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -39,7 +39,7 @@ def get_fixtures_path() -> Path: return Path(__file__).parent.joinpath("fixtures") -@lru_cache() +@lru_cache def load_fixture(name: str) -> dict[str, Any]: """Load a fixture.""" fixture_path = get_fixtures_path().joinpath(f"{name}.json") diff --git a/tests/conftest.py b/tests/conftest.py index 38a8281..69be621 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ """Configure tests.""" +from collections.abc import Generator from socket import inet_aton -from typing import Generator from unittest.mock import patch import pytest diff --git a/tests/mocks/mock_websocket.py b/tests/mocks/mock_websocket.py index aba8eaf..7f76167 100644 --- a/tests/mocks/mock_websocket.py +++ b/tests/mocks/mock_websocket.py @@ -95,7 +95,7 @@ def read() -> None: """Call registered callback method.""" data = self.sock.recv() if not data: - self._callback(self.on_error, self, Exception) + self._callback(self.on_error, Exception) elif data == str(ABNF.OPCODE_PONG): self._callback(self.on_pong, data) elif data == str(ABNF.OPCODE_CLOSE):