Skip to content

Commit 4aaafdd

Browse files
authored
[BUGFIX] Fix the path of test prompts (#2273)
1 parent 66b108d commit 4aaafdd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/conftest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
from vllm import LLM, SamplingParams
99
from vllm.transformers_utils.tokenizer import get_tokenizer
1010

11-
_TEST_PROMPTS = ["prompts/example.txt"]
12-
_LONG_PROMPTS = ["prompts/summary.txt"]
11+
_TEST_DIR = os.path.dirname(__file__)
12+
_TEST_PROMPTS = [os.path.join(_TEST_DIR, "prompts", "example.txt")]
13+
_LONG_PROMPTS = [os.path.join(_TEST_DIR, "prompts", "summary.txt")]
1314

1415

1516
def _read_prompts(filename: str) -> str:
@@ -24,15 +25,15 @@ def _read_prompts(filename: str) -> str:
2425
def example_prompts() -> List[str]:
2526
prompts = []
2627
for filename in _TEST_PROMPTS:
27-
prompts += _read_prompts(os.path.join("tests", filename))
28+
prompts += _read_prompts(filename)
2829
return prompts
2930

3031

3132
@pytest.fixture
3233
def example_long_prompts() -> List[str]:
3334
prompts = []
3435
for filename in _LONG_PROMPTS:
35-
prompts += _read_prompts(os.path.join("tests", filename))
36+
prompts += _read_prompts(filename)
3637
return prompts
3738

3839

0 commit comments

Comments
 (0)