test: adjust error format

This commit is contained in:
Xyphuz 2022-05-27 19:56:15 +08:00
parent ad5bad8d20
commit 2e50d1b4d1
2 changed files with 3 additions and 5 deletions

View file

@ -9,10 +9,10 @@ def test_parser_error_parsing_file() -> None:
def test_parser_invalid_yaml() -> 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") Parser().parse("tests/ymls/others/empty.yml")
def test_parser_no_services_found() -> None: 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") Parser().parse("tests/ymls/others/no-services.yml")

View file

@ -1,3 +1 @@
what-is-this: version: "A docker-compose file without services."
- "a yaml file without services"
- "test purpose"