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

Method indent

src/_pytest/_code/source.py:83–88  ·  view source on GitHub ↗

Return a copy of the source object with all lines indented by the given indent-string.

(self, indent: str = " " * 4)

Source from the content-addressed store, hash-verified

81 return source
82
83 def indent(self, indent: str = " " * 4) -> "Source":
84 """Return a copy of the source object with all lines indented by the
85 given indent-string."""
86 newsource = Source()
87 newsource.lines = [(indent + line) for line in self.lines]
88 return newsource
89
90 def getstatement(self, lineno: int) -> "Source":
91 """Return Source statement which contains the given linenumber

Callers 2

fail_fixturefuncFunction · 0.95

Calls 1

SourceClass · 0.85

Tested by 1