Signed-off-by: Yueqian Lin <linyueqian@outlook.com> Signed-off-by: Sy0307 <24841857+Sy0307@users.noreply.github.com> Co-authored-by: Sy0307 <24841857+Sy0307@users.noreply.github.com>
31 lines
849 B
Python
31 lines
849 B
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
def test_batched_runtime_import_does_not_require_optional_opus_dependency() -> None:
|
|
script = """
|
|
import builtins
|
|
|
|
real_import = builtins.__import__
|
|
|
|
def guarded_import(name, *args, **kwargs):
|
|
if name == "sphn":
|
|
raise ModuleNotFoundError("blocked optional dependency: sphn")
|
|
return real_import(name, *args, **kwargs)
|
|
|
|
builtins.__import__ = guarded_import
|
|
from vllm_omni.experimental.fullduplex.personaplex.serving.batched import BatchedSessionManager
|
|
assert BatchedSessionManager is not None
|
|
"""
|
|
result = subprocess.run(
|
|
[sys.executable, "-c", script],
|
|
check=False,
|
|
capture_output=True,
|
|
text=True,
|
|
)
|
|
|
|
assert result.returncode == 0, result.stderr
|