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

Function ensure_file

testing/test_collection.py:21–25  ·  view source on GitHub ↗

Ensure that file exists

(file_path: Path)

Source from the content-addressed store, hash-verified

19
20
21def ensure_file(file_path: Path) -> Path:
22 """Ensure that file exists"""
23 file_path.parent.mkdir(parents=True, exist_ok=True)
24 file_path.touch(exist_ok=True)
25 return file_path
26
27
28class TestCollector:

Calls 1

mkdirMethod · 0.45

Tested by

no test coverage detected