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

Method test_idmaker_idfn

testing/python/metafunc.py:460–477  ·  view source on GitHub ↗

#351

(self)

Source from the content-addressed store, hash-verified

458 assert result == ["Foo.one-Foo.two"]
459
460 def test_idmaker_idfn(self) -> None:
461 """#351"""
462
463 def ids(val: object) -> Optional[str]:
464 if isinstance(val, Exception):
465 return repr(val)
466 return None
467
468 result = idmaker(
469 ("a", "b"),
470 [
471 pytest.param(10.0, IndexError()),
472 pytest.param(20, KeyError()),
473 pytest.param("three", [1, 2, 3]),
474 ],
475 idfn=ids,
476 )
477 assert result == ["10.0-IndexError()", "20-KeyError()", "three-b2"]
478
479 def test_idmaker_idfn_unique_names(self) -> None:
480 """#351"""

Callers

nothing calls this directly

Calls 2

idmakerFunction · 0.90
paramMethod · 0.80

Tested by

no test coverage detected