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.
This commit is contained in:
redshift
2026-09-20 18:27:46 +08:00
parent dd9ccc95a6
commit 4f8f2bb1e0
2 changed files with 2 additions and 1 deletions
+2 -1
View File
@@ -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)