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

Method _idval

src/_pytest/python.py:998–1009  ·  src/_pytest/python.py::IdMaker._idval

Make an ID for a parameter in a ParameterSet.

(self, val: object, argname: str, idx: int)

Source from the content-addressed store, hash-verified

996 )
997
998 def _idval(self, val: object, argname: str, idx: int) -> str:
999 class="st">""class="st">"Make an ID for a parameter in a ParameterSet."class="st">""
1000 idval = self._idval_from_function(val, argname, idx)
1001 if idval is not None:
1002 return idval
1003 idval = self._idval_from_hook(val, argname)
1004 if idval is not None:
1005 return idval
1006 idval = self._idval_from_value(val)
1007 if idval is not None:
1008 return idval
1009 return self._idval_from_argname(argname, idx)
1010
1011 def _idval_from_function(self, val: object, argname: str, idx: int) -> str | None:
1012 class="st">"""Try to make an ID for a parameter in a ParameterSet using the

Callers 7

_resolve_idsMethod · 0.95
test_idval_hypothesisMethod · 0.80
test_unicode_idvalMethod · 0.80
test_bytes_idvalMethod · 0.80
test_notset_idvalMethod · 0.80

Calls 4

_idval_from_functionMethod · 0.95
_idval_from_hookMethod · 0.95
_idval_from_valueMethod · 0.95
_idval_from_argnameMethod · 0.95

Tested by 6

test_idval_hypothesisMethod · 0.64
test_unicode_idvalMethod · 0.64
test_bytes_idvalMethod · 0.64
test_notset_idvalMethod · 0.64