A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 2, 07:15 UTC
[BugFix][CI] Fix added `_has_module` tests (#44248)
Signed-off-by: Nick Hill <nickhill123@gmail.com>
Nick Hill committed
Jun 1, 2026 at 14:23 UTC
6f8b40a23fecd64809300dc88d9972318dec6c4a
1 file changed
-36
tests/utils_/test_import_utils.py
-36
@@ -83,42 +83,6 @@ class TestHasModule:
83
):
84
assert _has_module("fake_native_ext") is False
85
86
- def test_returns_false_on_os_error_during_import(self):
87
- """Some shared-library failures surface as ``OSError``."""
88
- fake_spec = MagicMock()
89
-
90
- with (
91
- patch(
92
- "vllm.utils.import_utils.importlib.util.find_spec",
93
- return_value=fake_spec,
94
- ),
95
- patch(
96
- "vllm.utils.import_utils.importlib.import_module",
97
- side_effect=OSError("cannot load library"),
98
- ),
99
- ):
100
- assert _has_module("fake_native_ext_os") is False
101
-
102
- def test_returns_false_on_unexpected_error_during_import(self):
103
- """A broken extension may raise a non-import error (e.g. ``RuntimeError``).
104
-
105
- Such modules are not usable, so ``_has_module`` should still return
106
- ``False`` rather than letting the exception propagate.
107
- """
108
- fake_spec = MagicMock()
109
-
110
- with (
111
- patch(
112
- "vllm.utils.import_utils.importlib.util.find_spec",
113
- return_value=fake_spec,
114
- ),
115
- patch(
116
- "vllm.utils.import_utils.importlib.import_module",
117
- side_effect=RuntimeError("CUDA driver version is insufficient"),
118
- ),
119
- ):
120
- assert _has_module("fake_broken_ext") is False
121
-
86
def test_returns_false_when_find_spec_raises(self):
87
"""``find_spec`` itself can raise for dotted names whose parent package
88
fails to import. This should be treated as the module being unavailable.