:param pytester: the instance of Pytester class, a temporary test directory.
(self, pytester: Pytester)
| 564 | assert result == [expected] |
| 565 | |
| 566 | def test_parametrize_ids_exception(self, pytester: Pytester) -> None: |
| 567 | """ |
| 568 | :param pytester: the instance of Pytester class, a temporary |
| 569 | test directory. |
| 570 | """ |
| 571 | pytester.makepyfile( |
| 572 | """ |
| 573 | import pytest |
| 574 | |
| 575 | def ids(arg): |
| 576 | raise Exception("bad ids") |
| 577 | |
| 578 | @pytest.mark.parametrize("arg", ["a", "b"], ids=ids) |
| 579 | def test_foo(arg): |
| 580 | pass |
| 581 | """ |
| 582 | ) |
| 583 | result = pytester.runpytest() |
| 584 | result.stdout.fnmatch_lines( |
| 585 | [ |
| 586 | "*Exception: bad ids", |
| 587 | "*test_foo: error raised while trying to determine id of parameter 'arg' at position 0", |
| 588 | ] |
| 589 | ) |
| 590 | |
| 591 | def test_parametrize_ids_returns_non_string(self, pytester: Pytester) -> None: |
| 592 | pytester.makepyfile( |
nothing calls this directly
no test coverage detected