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

Method test_parametrize_and_id

testing/python/metafunc.py:250–259  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

248 assert find_scope(["mixed_fix"], indirect=True) == Scope.Class
249
250 def test_parametrize_and_id(self) -> None:
251 def func(x, y):
252 pass
253
254 metafunc = self.Metafunc(func)
255
256 metafunc.parametrize("x", [1, 2], ids=["basic", "advanced"])
257 metafunc.parametrize("y", ["abc", "def"])
258 ids = [x.id for x in metafunc._calls]
259 assert ids == ["basic-abc", "basic-def", "advanced-abc", "advanced-def"]
260
261 def test_parametrize_and_id_unicode(self) -> None:
262 """Allow unicode strings for "ids" parameter in Python 2 (##1905)"""

Callers

nothing calls this directly

Calls 2

MetafuncMethod · 0.95
parametrizeMethod · 0.95

Tested by

no test coverage detected