[CI] Mock spawn for vlm tests (#5279)

### What this PR does / why we need it?
Using `spawn` in continuous testing scenarios
### Does this PR introduce _any_ user-facing change?

### How was this patch tested?

- vLLM version: release/v0.13.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/ad32e3e19ccf0526cb6744a5fed09a138a5fb2f9

---------

Signed-off-by: wangli <wangli858794774@gmail.com>
This commit is contained in:
Li Wang authored and GitHub committed 2025-12-23 18:35:06 +08:00
1 parent cb963c53a5
commit 5d1f6daef6
2 files changed
+8

No files matched your search

+5
View File
@@ -20,6 +20,9 @@
Run `pytest tests/test_offline_inference.py`.
"""
import os
from unittest.mock import patch
from vllm import SamplingParams
from vllm.assets.audio import AudioAsset
from vllm.assets.image import ImageAsset
@@ -27,6 +30,7 @@ from vllm.assets.image import ImageAsset
from tests.e2e.conftest import VllmRunner
@patch.dict(os.environ, {"VLLM_WORKER_MULTIPROC_METHOD": "spawn"})
def test_multimodal_vl(vl_config):
image = ImageAsset("cherry_blossom").pil_image.convert("RGB")
@@ -57,6 +61,7 @@ def test_multimodal_vl(vl_config):
assert output_str, "Generated output should not be empty."
@patch.dict(os.environ, {"VLLM_WORKER_MULTIPROC_METHOD": "spawn"})
def test_multimodal_audio():
audio_prompt = "".join([
f"Audio {idx+1}: <|audio_bos|><|AUDIO|><|audio_eos|>\n"