Skip to content

Commit 4695808

Browse files
authored
Fix websocket tests (#208)
1 parent 203c8d3 commit 4695808

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

devolo_home_control_api/publisher/publisher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
from __future__ import annotations
33

44
import logging
5-
from typing import Any, Callable, KeysView
5+
from collections.abc import KeysView
6+
from typing import Any, Callable
67

78

89
class Publisher:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ignore_missing_imports = true
5757
line-length = 127
5858
lint.ignore = ["ANN401", "B024", "COM812", "D203", "D205", "D212", "EM", "FBT001", "N818", "TCH", "TRY300", "TRY400"]
5959
lint.select = ["ALL"]
60-
target-version = "py37"
60+
target-version = "py39"
6161

6262
[tool.ruff.lint.isort]
6363
combine-as-imports = true

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_fixtures_path() -> Path:
3939
return Path(__file__).parent.joinpath("fixtures")
4040

4141

42-
@lru_cache()
42+
@lru_cache
4343
def load_fixture(name: str) -> dict[str, Any]:
4444
"""Load a fixture."""
4545
fixture_path = get_fixtures_path().joinpath(f"{name}.json")

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Configure tests."""
2+
from collections.abc import Generator
23
from socket import inet_aton
3-
from typing import Generator
44
from unittest.mock import patch
55

66
import pytest

tests/mocks/mock_websocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def read() -> None:
9595
"""Call registered callback method."""
9696
data = self.sock.recv()
9797
if not data:
98-
self._callback(self.on_error, self, Exception)
98+
self._callback(self.on_error, Exception)
9999
elif data == str(ABNF.OPCODE_PONG):
100100
self._callback(self.on_pong, data)
101101
elif data == str(ABNF.OPCODE_CLOSE):

0 commit comments

Comments
 (0)