Skip to content

Commit

Permalink
✅ Cover pyaml parsing error catcher
Browse files Browse the repository at this point in the history
  • Loading branch information
valentingol committed Dec 15, 2023
1 parent d13c9c1 commit 703c1ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/unit/test_dict_routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest
import pytest_check as check
from yaml.parser import ParserError

from cliconfig.dict_routines import (
_del_key,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 703c1ad

Please sign in to comment.