From d7ba3b6ab7ce30c0be175dccf33f1493c968c055 Mon Sep 17 00:00:00 2001 From: Tim Pietrusky Date: Fri, 19 Jun 2026 19:05:24 +0200 Subject: [PATCH] test: install pyyaml and isolate vllm config file in tests after rebasing onto main, get_engine_args() loads a vllm-style config via PyYAML (a transitive vllm dep). vllm is stubbed in tests, so add pyyaml explicitly and point VLLM_CONFIG_FILE at a nonexistent path so no stray config is picked up. --- tests/requirements.txt | 3 +++ tests/test_engine_args.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tests/requirements.txt b/tests/requirements.txt index ce1cb0d..917605c 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,3 +1,6 @@ # Test-only dependencies. vllm/torch are stubbed in conftest.py when absent, # so the unit tests run on a plain CPU runner without the GPU image. pytest>=8,<10 +# get_engine_args() reads a vLLM-style config via PyYAML (a transitive vllm dep +# at runtime); install it explicitly here since vllm itself is stubbed. +pyyaml diff --git a/tests/test_engine_args.py b/tests/test_engine_args.py index dce4d24..5a85a61 100644 --- a/tests/test_engine_args.py +++ b/tests/test_engine_args.py @@ -94,6 +94,8 @@ class TestGetEngineArgsServedName: # Avoid the network branch in _resolve_max_model_len. monkeypatch.setenv("MAX_NUM_BATCHED_TOKENS", "2048") monkeypatch.delenv("SERVED_MODEL_NAME", raising=False) + # Don't pick up a stray vLLM config file from the environment. + monkeypatch.setenv("VLLM_CONFIG_FILE", "/nonexistent-vllm-config.yaml") @requires_case_sensitive_fs def test_served_name_is_repo_id_when_path_rewritten(self, hf_cache, monkeypatch):