From 82e79514447258f4e1ed64b3fdba6267431d082c Mon Sep 17 00:00:00 2001 From: Xyphuz Date: Thu, 19 May 2022 00:43:45 +0800 Subject: [PATCH] test: change ValueError to AttributeError in Service initialization --- tests/test_service.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_service.py b/tests/test_service.py index 223f471..1f56b33 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -5,11 +5,13 @@ from compose_viz.service import Service def test_service_init() -> None: - with pytest.raises(ValueError, match=r"Both image and extends are not defined in service 'frontend', aborting."): + with pytest.raises( + AttributeError, match=r"Both image and extends are not defined in service 'frontend', aborting." + ): Service(name="frontend") with pytest.raises( - ValueError, match=r"Only one of image and extends can be defined in service 'frontend', aborting." + AttributeError, match=r"Only one of image and extends can be defined in service 'frontend', aborting." ): Service( name="frontend", image="image", extends=Extends(service_name="frontend", from_file="tests/in/000001.yaml")