Skip to content

Commit

Permalink
Skip vllm-related tests on non-linux platforms
Browse files Browse the repository at this point in the history
Fix #1356
  • Loading branch information
yvan-sraka authored and rlouf committed Jan 3, 2025
1 parent 6a8612b commit d32dfde
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test = [
"huggingface_hub",
"openai>=1.0.0",
"datasets",
"vllm; sys_platform != 'darwin'",
"vllm; sys_platform == 'linux'",
"transformers",
"pillow",
"exllamav2",
Expand Down
14 changes: 14 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sys

import pytest


def pytest_collection_modifyitems(config, items):
if sys.platform != "linux":
skip_vllm = pytest.mark.skip(reason="vLLM models can only be run on Linux.")
for item in items:
if "test_integration_vllm" in item.nodeid:
item.add_marker(skip_vllm)
print(
f"WARNING: {item.nodeid} is skipped because vLLM only supports Linux platform (including WSL)."
)
6 changes: 5 additions & 1 deletion tests/generate/test_integration_vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
import pytest
import torch
from pydantic import BaseModel, constr
from vllm.sampling_params import SamplingParams

try:
from vllm.sampling_params import SamplingParams
except ImportError:
pass

import outlines.generate as generate
import outlines.grammars as grammars
Expand Down

0 comments on commit d32dfde

Please sign in to comment.