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

Method getargs

src/_pytest/_code/code.py:176–188  ·  view source on GitHub ↗

Return a list of tuples (name, value) for all arguments. If 'var' is set True, also include the variable and keyword arguments when present.

(self, var: bool = False)

Source from the content-addressed store, hash-verified

174 return saferepr(object)
175
176 def getargs(self, var: bool = False):
177 """Return a list of tuples (name, value) for all arguments.
178
179 If 'var' is set True, also include the variable and keyword arguments
180 when present.
181 """
182 retval = []
183 for arg in self.code.getargs(var):
184 try:
185 retval.append((arg, self.f_locals[arg]))
186 except KeyError:
187 pass # this can occur when using Psyco
188 return retval
189
190
191class TracebackEntry:

Callers 1

test_frame_getargsFunction · 0.95

Calls 2

appendMethod · 0.80
getargsMethod · 0.45

Tested by 1

test_frame_getargsFunction · 0.76