(self, pytester: Pytester)
| 429 | """#351""" |
| 430 | |
| 431 | def test_idfn_marker(self, pytester: Pytester) -> None: |
| 432 | pytester.makepyfile( |
| 433 | """ |
| 434 | import pytest |
| 435 | |
| 436 | def idfn(param): |
| 437 | if param == 0: |
| 438 | return 'spam' |
| 439 | elif param == 1: |
| 440 | return 'ham' |
| 441 | else: |
| 442 | return None |
| 443 | |
| 444 | @pytest.mark.parametrize('a,b', [(0, 2), (1, 2)], ids=idfn) |
| 445 | def test_params(a, b): |
| 446 | pass |
| 447 | """ |
| 448 | ) |
| 449 | res = pytester.runpytest("--collect-only") |
| 450 | res.stdout.fnmatch_lines(["*spam-2*", "*ham-2*"]) |
| 451 | |
| 452 | def test_idfn_fixture(self, pytester: Pytester) -> None: |
| 453 | pytester.makepyfile( |
nothing calls this directly
no test coverage detected