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

Method _resolve_arg_ids

src/_pytest/python.py:1175–1206  ·  view source on GitHub ↗

Resolve the actual ids for the given argnames, based on the ``ids`` parameter given to ``parametrize``. :param List[str] argnames: List of argument names passed to ``parametrize()``. :param ids: The ids parameter of the parametrized call (see docs). :param List[Param

(
        self,
        argnames: Sequence[str],
        ids: Optional[
            Union[
                Iterable[Union[None, str, float, int, bool]],
                Callable[[Any], Optional[object]],
            ]
        ],
        parameters: Sequence[ParameterSet],
        nodeid: str,
    )

Source from the content-addressed store, hash-verified

1173 self._calls = newcalls
1174
1175 def _resolve_arg_ids(
1176 self,
1177 argnames: Sequence[str],
1178 ids: Optional[
1179 Union[
1180 Iterable[Union[None, str, float, int, bool]],
1181 Callable[[Any], Optional[object]],
1182 ]
1183 ],
1184 parameters: Sequence[ParameterSet],
1185 nodeid: str,
1186 ) -> List[str]:
1187 """Resolve the actual ids for the given argnames, based on the ``ids`` parameter given
1188 to ``parametrize``.
1189
1190 :param List[str] argnames: List of argument names passed to ``parametrize()``.
1191 :param ids: The ids parameter of the parametrized call (see docs).
1192 :param List[ParameterSet] parameters: The list of parameter values, same size as ``argnames``.
1193 :param str str: The nodeid of the item that generated this parametrized call.
1194 :rtype: List[str]
1195 :returns: The list of ids for each argname given.
1196 """
1197 if ids is None:
1198 idfn = None
1199 ids_ = None
1200 elif callable(ids):
1201 idfn = ids
1202 ids_ = None
1203 else:
1204 idfn = None
1205 ids_ = self._validate_ids(ids, parameters, self.function.__name__)
1206 return idmaker(argnames, parameters, idfn, ids_, self.config, nodeid=nodeid)
1207
1208 def _validate_ids(
1209 self,

Callers 1

parametrizeMethod · 0.95

Calls 2

_validate_idsMethod · 0.95
idmakerFunction · 0.85

Tested by

no test coverage detected