Skip to content

Commit 61c7a1b

Browse files
andoorveandoorve
and
andoorve
authored
[V1] Minor V1 async engine test refactor (#15075)
Signed-off-by: andoorve <[email protected]> Co-authored-by: andoorve <[email protected]>
1 parent 374ee28 commit 61c7a1b

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

tests/v1/engine/test_async_llm.py

+9-16
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,18 @@ async def generate(engine: AsyncLLM,
7676

7777
@pytest.mark.parametrize(
7878
"output_kind", [RequestOutputKind.DELTA, RequestOutputKind.FINAL_ONLY])
79-
@pytest.mark.parametrize("engine_args_and_prompt",
79+
@pytest.mark.parametrize("engine_args,prompt",
8080
[(TEXT_ENGINE_ARGS, TEXT_PROMPT),
8181
(VISION_ENGINE_ARGS, VISION_PROMPT)])
8282
@pytest.mark.asyncio
83-
async def test_load(
84-
monkeypatch: pytest.MonkeyPatch,
85-
output_kind: RequestOutputKind,
86-
engine_args_and_prompt: tuple[AsyncEngineArgs, PromptType],
87-
):
83+
async def test_load(monkeypatch: pytest.MonkeyPatch,
84+
output_kind: RequestOutputKind,
85+
engine_args: AsyncEngineArgs, prompt: PromptType):
8886
# TODO(rickyx): Remove monkeypatch once we have a better way to test V1
8987
# so that in the future when we switch, we don't have to change all the
9088
# tests.
9189
with monkeypatch.context() as m, ExitStack() as after:
9290
m.setenv("VLLM_USE_V1", "1")
93-
engine_args, prompt = engine_args_and_prompt
9491

9592
engine = AsyncLLM.from_engine_args(engine_args)
9693
after.callback(engine.shutdown)
@@ -124,18 +121,16 @@ async def test_load(
124121

125122
@pytest.mark.parametrize(
126123
"output_kind", [RequestOutputKind.DELTA, RequestOutputKind.FINAL_ONLY])
127-
@pytest.mark.parametrize("engine_args_and_prompt",
124+
@pytest.mark.parametrize("engine_args,prompt",
128125
[(TEXT_ENGINE_ARGS, TEXT_PROMPT),
129126
(VISION_ENGINE_ARGS, VISION_PROMPT)])
130127
@pytest.mark.asyncio
131128
async def test_abort(monkeypatch: pytest.MonkeyPatch,
132129
output_kind: RequestOutputKind,
133-
engine_args_and_prompt: tuple[AsyncEngineArgs,
134-
PromptType]):
130+
engine_args: AsyncEngineArgs, prompt: PromptType):
135131

136132
with monkeypatch.context() as m, ExitStack() as after:
137133
m.setenv("VLLM_USE_V1", "1")
138-
engine_args, prompt = engine_args_and_prompt
139134

140135
engine = AsyncLLM.from_engine_args(engine_args)
141136
after.callback(engine.shutdown)
@@ -193,17 +188,15 @@ async def test_abort(monkeypatch: pytest.MonkeyPatch,
193188

194189

195190
@pytest.mark.parametrize("n", [1, 3])
196-
@pytest.mark.parametrize("engine_args_and_prompt",
191+
@pytest.mark.parametrize("engine_args,prompt",
197192
[(TEXT_ENGINE_ARGS, TEXT_PROMPT),
198193
(VISION_ENGINE_ARGS, VISION_PROMPT)])
199194
@pytest.mark.asyncio
200-
async def test_finished_flag(monkeypatch, n: int,
201-
engine_args_and_prompt: tuple[AsyncEngineArgs,
202-
PromptType]):
195+
async def test_finished_flag(monkeypatch: pytest.MonkeyPatch, n: int,
196+
engine_args: AsyncEngineArgs, prompt: PromptType):
203197

204198
with monkeypatch.context() as m, ExitStack() as after:
205199
m.setenv("VLLM_USE_V1", "1")
206-
engine_args, prompt = engine_args_and_prompt
207200

208201
engine = AsyncLLM.from_engine_args(engine_args)
209202
after.callback(engine.shutdown)

0 commit comments

Comments
 (0)