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

Method test_idmaker_idfn_unique_names

testing/python/metafunc.py:479–494  ·  view source on GitHub ↗

#351

(self)

Source from the content-addressed store, hash-verified

477 assert result == ["10.0-IndexError()", "20-KeyError()", "three-b2"]
478
479 def test_idmaker_idfn_unique_names(self) -> None:
480 """#351"""
481
482 def ids(val: object) -> str:
483 return "a"
484
485 result = idmaker(
486 ("a", "b"),
487 [
488 pytest.param(10.0, IndexError()),
489 pytest.param(20, KeyError()),
490 pytest.param("three", [1, 2, 3]),
491 ],
492 idfn=ids,
493 )
494 assert result == ["a-a0", "a-a1", "a-a2"]
495
496 def test_idmaker_with_idfn_and_config(self) -> None:
497 """Unit test for expected behavior to create ids with idfn and

Callers

nothing calls this directly

Calls 2

idmakerFunction · 0.90
paramMethod · 0.80

Tested by

no test coverage detected