mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
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:
parent
d80c4f49a4
commit
d5f02997c2
2 changed files with 6 additions and 2 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue