Skip to content

Commit

Permalink
Added better error message for a nonstring marker
Browse files Browse the repository at this point in the history
  • Loading branch information
cadaniel02 committed Jun 6, 2024
1 parent 19848ed commit 2287454
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ def test_invalid_marker(marker: str) -> None:
with pytest.raises(ValueError, match="The marker has to be a single character"):
Dahlia(marker=marker)


@pytest.mark.parametrize("marker", [123, [1], {"key": "value"}])
def test_nonstring_marker(marker: str) -> None:
with pytest.raises(TypeError, match="The marker has to be a st"):
Dahlia(marker=marker)


@pytest.mark.parametrize(("auto_reset", "expected"), [(True, "\x1b[0m"), (False, "")])
def test_auto_reset(auto_reset: bool, expected: str) -> None:
assert Dahlia(auto_reset=auto_reset).convert("") == expected
Expand Down

0 comments on commit 2287454

Please sign in to comment.