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

Method source

src/_pytest/_code/code.py:108–111  ·  src/_pytest/_code/code.py::Code.source

Return a _pytest._code.Source object for the code object's source only.

(self)

Source from the content-addressed store, hash-verified

106 return full
107
108 def source(self) -> Source:
109 class="st">""class="st">"Return a _pytest._code.Source object for the code object&class="cm">#x27;s source only."class="st">""
110 class="cm"># return source only for that part of code
111 return Source(self.raw)
112
113 def getargs(self, var: bool = False) -> tuple[str, ...]:
114 class="st">"""Return a tuple with the argument names for the code object.

Callers 3

getmsgFunction · 0.80
test_code_sourceFunction · 0.80

Calls 1

SourceClass · 0.90

Tested by 3

getmsgFunction · 0.64
test_code_sourceFunction · 0.64