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

Function test_summary

codespell_lib/tests/test_basic.py:321–349  ·  view source on GitHub ↗

Test summary functionality.

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

Source from the content-addressed store, hash-verified

319
320
321def test_summary(
322 tmp_path: Path,
323 capsys: pytest.CaptureFixture[str],
324) -> None:
325 """Test summary functionality."""
326 fname = tmp_path / "tmp"
327 fname.touch()
328 result = cs.main(fname, std=True, count=False)
329 assert isinstance(result, tuple)
330 code, stdout, stderr = result
331 assert code == 0
332 assert not stdout
333 assert not stderr, "no output"
334 result = cs.main(fname, "--summary", std=True)
335 assert isinstance(result, tuple)
336 code, stdout, stderr = result
337 assert code == 0
338 assert stderr == "0\n"
339 assert "SUMMARY" in stdout
340 assert len(stdout.split("\n")) == 5
341 fname.write_text("abandonned\nabandonned")
342 assert code == 0
343 result = cs.main(fname, "--summary", std=True)
344 assert isinstance(result, tuple)
345 code, stdout, stderr = result
346 assert stderr == "2\n"
347 assert "SUMMARY" in stdout
348 assert len(stdout.split("\n")) == 7
349 assert "abandonned" in stdout.split()[-2]
350
351
352def test_ignore_dictionary(

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…