(self, pytester: Pytester)
| 3627 | |
| 3628 | class TestContextManagerFixtureFuncs: |
| 3629 | def test_simple(self, pytester: Pytester) -> None: |
| 3630 | pytester.makepyfile( |
| 3631 | """ |
| 3632 | import pytest |
| 3633 | @pytest.fixture |
| 3634 | def arg1(): |
| 3635 | print("setup") |
| 3636 | yield 1 |
| 3637 | print("teardown") |
| 3638 | def test_1(arg1): |
| 3639 | print("test1", arg1) |
| 3640 | def test_2(arg1): |
| 3641 | print("test2", arg1) |
| 3642 | assert 0 |
| 3643 | """ |
| 3644 | ) |
| 3645 | result = pytester.runpytest("-s") |
| 3646 | result.stdout.fnmatch_lines( |
| 3647 | """ |
| 3648 | *setup* |
| 3649 | *test1 1* |
| 3650 | *teardown* |
| 3651 | *setup* |
| 3652 | *test2 1* |
| 3653 | *teardown* |
| 3654 | """ |
| 3655 | ) |
| 3656 | |
| 3657 | def test_scoped(self, pytester: Pytester) -> None: |
| 3658 | pytester.makepyfile( |
nothing calls this directly
no test coverage detected