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

Method test_idmaker_idfn

testing/python/metafunc.py:551–571  ·  view source on GitHub ↗

#351

(self)

Source from the content-addressed store, hash-verified

549 assert result == ["Foo.one-Foo.two"]
550
551 def test_idmaker_idfn(self) -> None:
552 """#351"""
553
554 def ids(val: object) -> str | None:
555 if isinstance(val, Exception):
556 return repr(val)
557 return None
558
559 result = IdMaker(
560 ("a", "b"),
561 [
562 pytest.param(10.0, IndexError()),
563 pytest.param(20, KeyError()),
564 pytest.param("three", [1, 2, 3]),
565 ],
566 ids,
567 None,
568 None,
569 None,
570 ).make_unique_parameterset_ids()
571 assert result == ["10.0-IndexError()", "20-KeyError()", "three-b2"]
572
573 def test_idmaker_idfn_unique_names(self) -> None:
574 """#351"""

Callers

nothing calls this directly

Calls 3

IdMakerClass · 0.90
paramMethod · 0.80

Tested by

no test coverage detected