Skip to content

Commit cadf224

Browse files
authored
[Tests] Silence warning in pytest due to string conversion (#299)
### silence warning in pytest due to string conversion silences warnings of this type: `PytestWarning: Value of environment variable x type should be str, but got 0 (type: int); converted to str implicitly` Signed-off-by: Yannick Schnider <yannick.schnider1@ibm.com>
1 parent 6fb0a8c commit cadf224

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/e2e/test_spyre_prompt_logprobs.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def test_prompt_logprobs(
3838

3939
prompts = get_chicken_soup_prompts(4)
4040

41-
monkeypatch.setenv("VLLM_USE_V1", 1)
41+
monkeypatch.setenv("VLLM_USE_V1", "1")
4242
monkeypatch.setenv("VLLM_SPYRE_DYNAMO_BACKEND", backend)
43-
monkeypatch.setenv("VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS", 1)
43+
monkeypatch.setenv("VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS", "1")
4444
llm = LLM(model, tensor_parallel_size=tp_size, tokenizer=model)
4545

4646
responses: list[RequestOutput] = llm.generate(
@@ -63,7 +63,7 @@ def test_prompt_logprobs(
6363
@pytest.mark.decoder
6464
def test_prompt_logprobs_must_be_enabled(monkeypatch: pytest.MonkeyPatch):
6565
# If prompt logprobs is disabled, requests are rejected
66-
monkeypatch.setenv("VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS", 0)
66+
monkeypatch.setenv("VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS", "0")
6767
params = SamplingParams(prompt_logprobs=5)
6868

6969
with pytest.raises(ValueError, match="VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS"):
@@ -76,8 +76,8 @@ def test_prompt_logprobs_not_supported_with_cb(
7676
monkeypatch: pytest.MonkeyPatch):
7777
# Server shouldn't boot with both prompt logprobs and continuous batching
7878
# enabled
79-
monkeypatch.setenv("VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS", 1)
80-
monkeypatch.setenv("VLLM_SPYRE_USE_CB", 1)
79+
monkeypatch.setenv("VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS", "1")
80+
monkeypatch.setenv("VLLM_SPYRE_USE_CB", "1")
8181

8282
with pytest.raises(ValueError, match="continuous batching"):
8383
VllmConfig(model_config=ModelConfig(task="generate"))
@@ -88,8 +88,8 @@ def test_prompt_logprobs_not_supported_with_cb(
8888
def test_prompt_logprobs_on_single_requests_only(
8989
monkeypatch: pytest.MonkeyPatch):
9090
# Only bs=1 is supported for prompt logprobs
91-
monkeypatch.setenv("VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS", 1)
92-
monkeypatch.setenv("VLLM_SPYRE_WARMUP_BATCH_SIZES", 2)
91+
monkeypatch.setenv("VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS", "1")
92+
monkeypatch.setenv("VLLM_SPYRE_WARMUP_BATCH_SIZES", "2")
9393

9494
with pytest.raises(ValueError, match="batch size 1"):
9595
VllmConfig(model_config=ModelConfig(task="generate"))

0 commit comments

Comments
 (0)