Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "violet-poolController-api"
version = "0.0.25"
version = "0.0.26"
authors = [
{ name="Basti (Xerolux)", email="git@xerolux.de" },
]
Expand All @@ -24,12 +24,12 @@ classifiers = [
"Topic :: Home Automation",
]
dependencies = [
"aiohttp>=3.11.0",
"aiohttp>=3.11.0,<3.14",
]

[project.optional-dependencies]
test = [
"aioresponses>=0.7.7",
"aioresponses>=0.7.8",
"pytest>=8.3",
"pytest-asyncio>=0.24",
]
Expand All @@ -45,13 +45,13 @@ asyncio_mode = "auto"

[tool.ruff]
line-length = 100
target-version = "0.0.25"
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP"]
ignore = ["E501"]

[tool.mypy]
python_version = "0.0.25"
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
40 changes: 40 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# violet-poolController-api - API für Violet Pool Controller
# Copyright (C) 2024-2026 Xerolux
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

"""Pytest configuration and fixtures."""

from __future__ import annotations

from inspect import signature

import aiohttp.client_reqrep

_original_client_response_init = aiohttp.client_reqrep.ClientResponse.__init__


def _patched_client_response_init(
self: aiohttp.client_reqrep.ClientResponse,
*args: object,
**kwargs: object,
) -> None:
"""Patched ClientResponse.__init__ that adds stream_writer if missing."""
sig = signature(_original_client_response_init)
if "stream_writer" in sig.parameters and "stream_writer" not in kwargs:
kwargs["stream_writer"] = None
_original_client_response_init(self, *args, **kwargs)


aiohttp.client_reqrep.ClientResponse.__init__ = _patched_client_response_init
Loading