From d5f02997c28d82a2ea89931f3bc486b5e360cc95 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Sat, 20 Jun 2026 08:10:56 +0000 Subject: [PATCH] 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. --- tests/e2e/budgets/test_budget_enforcement_e2e.py | 6 +++++- tests/e2e/conftest.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/e2e/budgets/test_budget_enforcement_e2e.py b/tests/e2e/budgets/test_budget_enforcement_e2e.py index ea2fba47331..d03288b637a 100644 --- a/tests/e2e/budgets/test_budget_enforcement_e2e.py +++ b/tests/e2e/budgets/test_budget_enforcement_e2e.py @@ -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] diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index f792244fd57..d9930170add 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -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)