(self, pytester: Pytester)
| 149 | |
| 150 | class TestPerTestCapturing: |
| 151 | def test_capture_and_fixtures(self, pytester: Pytester) -> None: |
| 152 | p = pytester.makepyfile( |
| 153 | """ |
| 154 | def setup_module(mod): |
| 155 | print("setup module") |
| 156 | def setup_function(function): |
| 157 | print("setup " + function.__name__) |
| 158 | def test_func1(): |
| 159 | print("in func1") |
| 160 | assert 0 |
| 161 | def test_func2(): |
| 162 | print("in func2") |
| 163 | assert 0 |
| 164 | """ |
| 165 | ) |
| 166 | result = pytester.runpytest(p) |
| 167 | result.stdout.fnmatch_lines( |
| 168 | [ |
| 169 | "setup module*", |
| 170 | "setup test_func1*", |
| 171 | "in func1*", |
| 172 | "setup test_func2*", |
| 173 | "in func2*", |
| 174 | ] |
| 175 | ) |
| 176 | |
| 177 | @pytest.mark.xfail(reason="unimplemented feature") |
| 178 | def test_capture_scope_cache(self, pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected