Skip to content

Commit 91a5138

Browse files
committed
Fix async VuMark test coverage
1 parent 58c5431 commit 91a5138

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

tests/test_async_vws_exceptions.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -411,16 +411,17 @@ async def test_documented_vumark_error_codes(
411411
) -> None:
412412
"""Documented VuMark failures raise matching exceptions."""
413413
with MockVWS(vumark_generation_failure=failure):
414-
async with AsyncVuMarkService(
414+
vumark_service = AsyncVuMarkService(
415415
server_access_key=uuid.uuid4().hex,
416416
server_secret_key=uuid.uuid4().hex,
417-
) as vumark_service:
418-
with pytest.raises(expected_exception=exception_type) as exc:
419-
await vumark_service.generate_vumark_instance(
420-
target_id="exampletargetid",
421-
instance_id="example_instance_id",
422-
accept=VuMarkAccept.PNG,
423-
)
417+
)
418+
with pytest.raises(expected_exception=exception_type) as exc:
419+
await vumark_service.generate_vumark_instance(
420+
target_id="exampletargetid",
421+
instance_id="example_instance_id",
422+
accept=VuMarkAccept.PNG,
423+
)
424+
await vumark_service.aclose()
424425

425426
assert exc.value.response.status_code == status_code
426427
assert failure.value in exc.value.response.text

0 commit comments

Comments
 (0)