MCPcopy Index your code
hub / github.com/python/mypy / add_file

Method add_file

mypy/test/teststubgen.py:935–942  ·  view source on GitHub ↗
(self, path: str, result: list[str], header: bool)

Source from the content-addressed store, hash-verified

933 return ["main"]
934
935 def add_file(self, path: str, result: list[str], header: bool) -> None:
936 if not os.path.exists(path):
937 result.append("<%s was not generated>" % path.replace("\\", "/"))
938 return
939 if header:
940 result.append(f"# {path[4:]}")
941 with open(path, encoding="utf8") as file:
942 result.extend(file.read().splitlines())
943
944
945self_arg = ArgSig(name="self")

Callers 1

run_case_innerMethod · 0.95

Calls 6

existsMethod · 0.80
appendMethod · 0.80
replaceMethod · 0.80
extendMethod · 0.80
splitlinesMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected