MCPcopy
hub / github.com/pytest-dev/pytest / test_open_and_ensure

Method test_open_and_ensure

testing/_py/test_local.py:710–714  ·  view source on GitHub ↗
(self, path1)

Source from the content-addressed store, hash-verified

708 assert sorted(lst) == [path4, path2, path3]
709
710 def test_open_and_ensure(self, path1):
711 p = path1.join("sub1", "sub2", "file")
712 with p.open("w", ensure=1, encoding="utf-8") as f:
713 f.write("hello")
714 assert p.read_text(encoding="utf-8") == "hello"
715
716 def test_write_and_ensure(self, path1):
717 p = path1.join("sub1", "sub2", "file")

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
openMethod · 0.80
read_textMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected