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

Function ensure_file

testing/test_collection.py:27–31  ·  view source on GitHub ↗

Ensure that file exists

(file_path: Path)

Source from the content-addressed store, hash-verified

25
26
27def ensure_file(file_path: Path) -> Path:
28 """Ensure that file exists"""
29 file_path.parent.mkdir(parents=True, exist_ok=True)
30 file_path.touch(exist_ok=True)
31 return file_path
32
33
34class TestCollector:

Calls 1

mkdirMethod · 0.45

Tested by

no test coverage detected