From 2e50d1b4d1a5b482fda9e0a90e689758efe79b0d Mon Sep 17 00:00:00 2001 From: Xyphuz Date: Fri, 27 May 2022 19:56:15 +0800 Subject: [PATCH] test: adjust error format --- tests/test_parser.py | 4 ++-- tests/ymls/others/no-services.yml | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index 0e3d33f..cf996c1 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -9,10 +9,10 @@ def test_parser_error_parsing_file() -> None: def test_parser_invalid_yaml() -> None: - with pytest.raises(RuntimeError, match=r"Empty yaml file, aborting."): + with pytest.raises(RuntimeError, match=r"Error parsing file 'tests/ymls/others/empty.yml'.*"): Parser().parse("tests/ymls/others/empty.yml") def test_parser_no_services_found() -> None: - with pytest.raises(RuntimeError, match=r"No services found, aborting."): + with pytest.raises(AssertionError, match=r"No services found, aborting."): Parser().parse("tests/ymls/others/no-services.yml") diff --git a/tests/ymls/others/no-services.yml b/tests/ymls/others/no-services.yml index a0bf4a1..30200b0 100644 --- a/tests/ymls/others/no-services.yml +++ b/tests/ymls/others/no-services.yml @@ -1,3 +1 @@ -what-is-this: - - "a yaml file without services" - - "test purpose" +version: "A docker-compose file without services."