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 authored and DimitriPapadopoulos committed Mar 15, 2023
1 parent a5508fe commit b152607
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions codespell_lib/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ def test_encoding(
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,
capsys: pytest.CaptureFixture[str],
Expand Down

0 comments on commit b152607

Please sign in to comment.