From e9e7e32142dcebc7080fe0e27583ca443bdb1c25 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Mon, 19 Oct 2026 14:30:57 -0700 Subject: [PATCH] test(count_tokens): make strict error envelope coverage explicit --- .../providers/test_count_tokens_error_shapes_wire.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/integration/providers/test_count_tokens_error_shapes_wire.py b/tests/integration/providers/test_count_tokens_error_shapes_wire.py index 200f5e81673..74581e44310 100644 --- a/tests/integration/providers/test_count_tokens_error_shapes_wire.py +++ b/tests/integration/providers/test_count_tokens_error_shapes_wire.py @@ -1,5 +1,6 @@ import json from collections.abc import Iterator +from pathlib import Path from typing import Final import anthropic @@ -29,13 +30,22 @@ _PROVIDER_KEY_VARIABLES: Final = ( @pytest.fixture(scope="module") -def keyless_proxy(tmp_path_factory: pytest.TempPathFactory) -> Iterator[OwnedProxy]: +def provider_error_config(tmp_path_factory: pytest.TempPathFactory) -> Path: + config: Final = tmp_path_factory.mktemp("count-tokens-provider-errors") / "config.yaml" + base: Final = Path(__file__).resolve().parents[1] / "proxy_config.yaml" + config.write_text(base.read_text() + "\nlitellm_settings:\n disable_token_counter: true\n") + return config + + +@pytest.fixture(scope="module") +def keyless_proxy(tmp_path_factory: pytest.TempPathFactory, provider_error_config: Path) -> Iterator[OwnedProxy]: with ( gateway_from_environment() as gateway, owned_proxy_process( gateway, tmp_path_factory.mktemp("count-tokens-error-shapes"), {}, + config=provider_error_config, remove_environment=_PROVIDER_KEY_VARIABLES, workers=1, ) as owned,