MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_readonly

Method test_readonly

testing/test_assertrewrite.py:827–840  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

825 assert pytester.runpytest("-vv").ret == ExitCode.OK
826
827 def test_readonly(self, pytester: Pytester) -> None:
828 sub = pytester.mkdir("testing")
829 sub.joinpath("test_readonly.py").write_bytes(
830 b"""
831def test_rewritten():
832 assert "@py_builtins" in globals()
833 """,
834 )
835 old_mode = sub.stat().st_mode
836 sub.chmod(320)
837 try:
838 assert pytester.runpytest().ret == 0
839 finally:
840 sub.chmod(old_mode)
841
842 def test_dont_write_bytecode(self, pytester: Pytester, monkeypatch) -> None:
843 monkeypatch.delenv("PYTHONPYCACHEPREFIX", raising=False)

Callers

nothing calls this directly

Calls 2

mkdirMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected