mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-02 02:11:58 +00:00
test(caching): skip the disk round trip when the optional diskcache extra is absent
The default CI test environment does not install litellm[caching], so the disk parametrization raised ModuleNotFoundError there. importorskip keeps the coverage wherever the extra is present and skips cleanly otherwise.
This commit is contained in:
parent
6fc11546f0
commit
b29e0c6c87
1 changed files with 5 additions and 0 deletions
|
|
@ -41,6 +41,11 @@ def _make_response_with_citations() -> ModelResponse:
|
|||
|
||||
@pytest.mark.parametrize("cache_type", ["local", "disk"])
|
||||
def test_cache_round_trip_preserves_provider_specific_fields(cache_type, tmp_path):
|
||||
if cache_type == "disk":
|
||||
# DiskCache is an optional extra (`litellm[caching]`); the default CI
|
||||
# test environment does not install it, so exercise that path only
|
||||
# where the dependency is present.
|
||||
pytest.importorskip("diskcache")
|
||||
litellm.cache = Cache(type=cache_type, disk_cache_dir=str(tmp_path / "litellm_cache"))
|
||||
try:
|
||||
kwargs = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue