refactor(e2e): make suite pass its shipped strict basedpyright config

The suite ships tests/pyrightconfig.json (strict, no Any), but basedpyright
--project tests reported four errors in it: three reportAny on the parametrize
ids=lambda c: c.__name__, and one reportUnusedFunction on the underscore-prefixed
autouse fixture _require_live_proxy. Replace the untyped lambda with a typed
_case_id(case_cls: Type[_BudgetCase]) -> str so the ids are no longer Any, and
rename the fixture to require_live_proxy so basedpyright no longer treats it as an
unused private function (it is referenced only by pytest's autouse machinery).
basedpyright --project tests now reports zero errors.
This commit is contained in:
mateo-berri 2026-06-20 08:10:56 +00:00
parent d80c4f49a4
commit d5f02997c2
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View file

@ -127,6 +127,10 @@ class TeamMemberBudgetCase(_BudgetCase):
self._undo.append(lambda: self.client.delete_key(self.key))
def _case_id(case_cls: Type[_BudgetCase]) -> str:
return case_cls.__name__
@pytest.mark.parametrize(
"case_cls",
[
@ -136,7 +140,7 @@ class TeamMemberBudgetCase(_BudgetCase):
OrganizationBudgetCase,
TeamMemberBudgetCase,
],
ids=lambda c: c.__name__,
ids=_case_id,
)
def test_budget_enforcement(
client: BudgetClient, case_cls: Type[_BudgetCase]

View file

@ -63,7 +63,7 @@ def pytest_sessionfinish(session: pytest.Session, exitstatus: int) -> None:
@pytest.fixture(scope="session", autouse=True)
def _require_live_proxy() -> None:
def require_live_proxy() -> None:
"""Skip the entire session unless a proxy answers its liveness probe."""
try:
resp = requests.get(f"{PROXY_BASE_URL}/health/liveliness", timeout=5)