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

Function test_permission_error

codespell_lib/tests/test_basic.py:237–252  ·  view source on GitHub ↗

Test permission error handling.

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

Source from the content-addressed store, hash-verified

235
236@pytest.mark.skipif(sys.platform != "linux", reason="Only supported on Linux")
237def test_permission_error(
238 tmp_path: Path,
239 capsys: pytest.CaptureFixture[str],
240) -> None:
241 """Test permission error handling."""
242 fname = tmp_path / "unreadable.txt"
243 fname.write_text("abandonned\n")
244 result = cs.main(fname, std=True)
245 assert isinstance(result, tuple)
246 _, _, stderr = result
247 assert "WARNING:" not in stderr
248 fname.chmod(0o000)
249 result = cs.main(fname, std=True)
250 assert isinstance(result, tuple)
251 _, _, stderr = result
252 assert "WARNING:" in stderr
253
254
255def test_interactivity(

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…