mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user