(self, pytester: Pytester)
| 450 | res.stdout.fnmatch_lines(["*spam-2*", "*ham-2*"]) |
| 451 | |
| 452 | def test_idfn_fixture(self, pytester: Pytester) -> None: |
| 453 | pytester.makepyfile( |
| 454 | """ |
| 455 | import pytest |
| 456 | |
| 457 | def idfn(param): |
| 458 | if param == 0: |
| 459 | return 'spam' |
| 460 | elif param == 1: |
| 461 | return 'ham' |
| 462 | else: |
| 463 | return None |
| 464 | |
| 465 | @pytest.fixture(params=[0, 1], ids=idfn) |
| 466 | def a(request): |
| 467 | return request.param |
| 468 | |
| 469 | @pytest.fixture(params=[1, 2], ids=idfn) |
| 470 | def b(request): |
| 471 | return request.param |
| 472 | |
| 473 | def test_params(a, b): |
| 474 | pass |
| 475 | """ |
| 476 | ) |
| 477 | res = pytester.runpytest("--collect-only") |
| 478 | res.stdout.fnmatch_lines(["*spam-2*", "*ham-2*"]) |
| 479 | |
| 480 | |
| 481 | def test_function_instance(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected