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

Method test_idmaker_idfn

testing/python/metafunc.py:551–571  ·  testing/python/metafunc.py::TestMetafunc.test_idmaker_idfn

#351

(self)

Source from the content-addressed store, hash-verified

549 assert result == [class="st">"Foo.one-Foo.two"]
550
551 def test_idmaker_idfn(self) -> None:
552 class="st">""class="st">"class="cm">#351"class="st">""
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 (class="st">"a", class="st">"b"),
561 [
562 pytest.param(10.0, IndexError()),
563 pytest.param(20, KeyError()),
564 pytest.param(class="st">"three", [1, 2, 3]),
565 ],
566 ids,
567 None,
568 None,
569 None,
570 ).make_unique_parameterset_ids()
571 assert result == [class="st">"10.0-IndexError()", class="st">"20-KeyError()", class="st">"three-b2"]
572
573 def test_idmaker_idfn_unique_names(self) -> None:
574 class="st">""class="st">"class="cm">#351"class="st">""

Callers

nothing calls this directly

Calls 3

IdMakerClass · 0.90
paramMethod · 0.80

Tested by

no test coverage detected