From 703c1ad837dd6a21ab86d16da8977a7fc6d20ba9 Mon Sep 17 00:00:00 2001 From: valentingol Date: Fri, 15 Dec 2023 15:02:06 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Cover=20pyaml=20parsing=20error=20c?= =?UTF-8?q?atcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/test_dict_routines.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/test_dict_routines.py b/tests/unit/test_dict_routines.py index cc3443b..e68e508 100644 --- a/tests/unit/test_dict_routines.py +++ b/tests/unit/test_dict_routines.py @@ -4,6 +4,7 @@ import pytest import pytest_check as check +from yaml.parser import ParserError from cliconfig.dict_routines import ( _del_key, @@ -177,6 +178,9 @@ def test_save_load_dict() -> None: } check.equal(out_dict, expected_dict) shutil.rmtree("tests/tmp") + # Case error while parsing + with pytest.raises(ParserError, match=".*tests/configs/wrong.yaml.*"): + load_dict("tests/configs/wrong.yaml") def test_show_dict() -> None: