MCPcopy Index your code
hub / github.com/codespell-project/codespell / test_custom_regex

Function test_custom_regex

codespell_lib/tests/test_basic.py:496–508  ·  view source on GitHub ↗

Test custom word regex.

(
    tmp_path: Path,
    capsys: pytest.CaptureFixture[str],
)

Source from the content-addressed store, hash-verified

494
495
496def test_custom_regex(
497 tmp_path: Path,
498 capsys: pytest.CaptureFixture[str],
499) -> None:
500 """Test custom word regex."""
501 (tmp_path / "bad.txt").write_text("abandonned_abondon\n")
502 assert cs.main(tmp_path) == 0
503 assert cs.main("-r", "[a-z]+", tmp_path) == 2
504 result = cs.main("-r", "[a-z]+", "--write-changes", tmp_path, std=True)
505 assert isinstance(result, tuple)
506 code, _, stderr = result
507 assert code == EX_USAGE
508 assert "ERROR:" in stderr
509
510
511def test_exclude_file(

Callers

nothing calls this directly

Calls 1

mainMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…