(self, pytester: Pytester)
| 2527 | reprec.assertoutcome(passed=1) |
| 2528 | |
| 2529 | def test_parametrize_and_scope(self, pytester: Pytester) -> None: |
| 2530 | pytester.makepyfile( |
| 2531 | """ |
| 2532 | import pytest |
| 2533 | @pytest.fixture(scope="module", params=["a", "b", "c"]) |
| 2534 | def arg(request): |
| 2535 | return request.param |
| 2536 | values = [] |
| 2537 | def test_param(arg): |
| 2538 | values.append(arg) |
| 2539 | """ |
| 2540 | ) |
| 2541 | reprec = pytester.inline_run("-v") |
| 2542 | reprec.assertoutcome(passed=3) |
| 2543 | values = reprec.getcalls("pytest_runtest_call")[0].item.module.values |
| 2544 | assert len(values) == 3 |
| 2545 | assert "a" in values |
| 2546 | assert "b" in values |
| 2547 | assert "c" in values |
| 2548 | |
| 2549 | def test_scope_mismatch(self, pytester: Pytester) -> None: |
| 2550 | pytester.makeconftest( |
nothing calls this directly
no test coverage detected