Skip to content

Commit 75d9325

Browse files
committed
Switch to pytest.importorskip
Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
1 parent 017fec0 commit 75d9325

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

tests/llmcompressor/modeling/test_calib_qwen3_vl_moe.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@
55
from llmcompressor.utils.helpers import calibration_forward_context
66
from tests.testing_utils import requires_gpu
77

8-
try:
9-
from transformers import Qwen3VLMoeConfig
10-
from transformers.models.qwen3_vl_moe.modeling_qwen3_vl_moe import (
11-
Qwen3VLMoeTextSparseMoeBlock,
12-
)
13-
except ImportError:
14-
Qwen3VLMoeConfig = None
15-
Qwen3VLMoeTextSparseMoeBlock = None
8+
Qwen3VLMoeConfig = pytest.importorskip(
9+
"transformers.models.qwen3_vl_moe.configuration_qwen3_vl_moe",
10+
reason="Qwen3VLMoeConfig not available in this version of transformers",
11+
).Qwen3VLMoeConfig
12+
Qwen3VLMoeTextSparseMoeBlock = pytest.importorskip(
13+
"transformers.models.qwen3_vl_moe.modeling_qwen3_vl_moe",
14+
reason="Qwen3VLMoeTextSparseMoeBlock not available in this version of transformers",
15+
).Qwen3VLMoeTextSparseMoeBlock
1616

1717

18-
@pytest.mark.skipif(
19-
Qwen3VLMoeConfig is None,
20-
reason="Qwen3VLMoe not available in this version of transformers",
21-
)
2218
@requires_gpu
2319
def test_calib_qwen3_vl_moe_module():
2420
config = Qwen3VLMoeConfig()

0 commit comments

Comments
 (0)