(self, pytester: Pytester)
| 2416 | reprec.assertoutcome(passed=4) |
| 2417 | |
| 2418 | def test_scope_mismatch_various(self, pytester: Pytester) -> None: |
| 2419 | pytester.makeconftest( |
| 2420 | """ |
| 2421 | import pytest |
| 2422 | finalized = [] |
| 2423 | created = [] |
| 2424 | @pytest.fixture(scope="function") |
| 2425 | def arg(request): |
| 2426 | pass |
| 2427 | """ |
| 2428 | ) |
| 2429 | pytester.makepyfile( |
| 2430 | test_mod1=""" |
| 2431 | import pytest |
| 2432 | @pytest.fixture(scope="session") |
| 2433 | def arg(request): |
| 2434 | request.getfixturevalue("arg") |
| 2435 | def test_1(arg): |
| 2436 | pass |
| 2437 | """ |
| 2438 | ) |
| 2439 | result = pytester.runpytest() |
| 2440 | assert result.ret != 0 |
| 2441 | result.stdout.fnmatch_lines( |
| 2442 | ["*ScopeMismatch*You tried*function*session*request*"] |
| 2443 | ) |
| 2444 | |
| 2445 | def test_dynamic_scope(self, pytester: Pytester) -> None: |
| 2446 | pytester.makeconftest( |
nothing calls this directly
no test coverage detected