Skip to content

Commit

Permalink
Add test for unknown encoding using chardet
Browse files Browse the repository at this point in the history
  • Loading branch information
n-thumann committed Mar 14, 2023
1 parent a326b44 commit b989b30
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions codespell_lib/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ def test_encoding(
assert stdout == ""
assert "WARNING: Binary file" in stderr

def test_unknown_encoding_chardet(
tmp_path: Path,
capsys: pytest.CaptureFixture[str],
) -> None:
"""Test opening a file with unknown encoding using chardet"""
fname = tmp_path / "tmp"
fname.touch()
assert cs.main("--hard-encoding-detection", fname) == 0

def test_ignore(
tmp_path: Path,
Expand Down

0 comments on commit b989b30

Please sign in to comment.