#351
(self)
| 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 |