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

Method _idval_from_hook

src/_pytest/python.py:1027–1035  ·  view source on GitHub ↗

Try to make an ID for a parameter in a ParameterSet by calling the :hook:`pytest_make_parametrize_id` hook.

(self, val: object, argname: str)

Source from the content-addressed store, hash-verified

1025 return self._idval_from_value(id)
1026
1027 def _idval_from_hook(self, val: object, argname: str) -> str | None:
1028 """Try to make an ID for a parameter in a ParameterSet by calling the
1029 :hook:`pytest_make_parametrize_id` hook."""
1030 if self.config:
1031 id: str | None = self.config.hook.pytest_make_parametrize_id(
1032 config=self.config, val=val, argname=argname
1033 )
1034 return id
1035 return None
1036
1037 def _idval_from_value(self, val: object) -> str | None:
1038 """Try to make an ID for a parameter in a ParameterSet from its value,

Callers 1

_idvalMethod · 0.95

Calls 1

Tested by

no test coverage detected