From 4f8f2bb1e07d754bd784dc636556993799c99182 Mon Sep 17 00:00:00 2001 From: redshift <213178690+1ftredsh@users.noreply.github.com> Date: Sun, 20 Sep 2026 18:27:46 +0800 Subject: [PATCH] fix(systemone): annotate test patch helper for mypy; move change report to docs/ - tests/unit/test_typesafe_integration.py: `_patch_client` returned `unittest.mock.patch`, which mypy rejects as a type ("not valid as a type"), cascading into six `patch? has no attribute __enter__/__exit__` errors on the `with` statements. Annotate the helper as `Any`, matching the convention used elsewhere in tests/. - Move SYSTEMONE_TYPESAFE.md to docs/ so the change report ships with the documentation tree. --- SYSTEMONE_TYPESAFE.md => docs/SYSTEMONE_TYPESAFE.md | 0 tests/unit/test_typesafe_integration.py | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename SYSTEMONE_TYPESAFE.md => docs/SYSTEMONE_TYPESAFE.md (100%) diff --git a/SYSTEMONE_TYPESAFE.md b/docs/SYSTEMONE_TYPESAFE.md similarity index 100% rename from SYSTEMONE_TYPESAFE.md rename to docs/SYSTEMONE_TYPESAFE.md diff --git a/tests/unit/test_typesafe_integration.py b/tests/unit/test_typesafe_integration.py index a3cb2018..3eb02993 100644 --- a/tests/unit/test_typesafe_integration.py +++ b/tests/unit/test_typesafe_integration.py @@ -12,6 +12,7 @@ Covers the three integration seams the systemone endpoint touches: from __future__ import annotations import os +from typing import Any os.environ.setdefault("UPSTREAM_BASE_URL", "http://test") os.environ.setdefault("UPSTREAM_API_KEY", "test") @@ -77,7 +78,7 @@ def _mock_models_response(payload: dict) -> MagicMock: return mock_response -def _patch_client(mock_response: MagicMock) -> patch: +def _patch_client(mock_response: MagicMock) -> Any: mock_client = MagicMock() mock_client.__aenter__ = AsyncMock(return_value=mock_client) mock_client.__aexit__ = AsyncMock(return_value=None)