(self, pytester: Pytester)
| 218 | assert "in func2" in s |
| 219 | |
| 220 | def test_teardown_capturing(self, pytester: Pytester) -> None: |
| 221 | p = pytester.makepyfile( |
| 222 | """ |
| 223 | def setup_function(function): |
| 224 | print("setup func1") |
| 225 | def teardown_function(function): |
| 226 | print("teardown func1") |
| 227 | assert 0 |
| 228 | def test_func1(): |
| 229 | print("in func1") |
| 230 | pass |
| 231 | """ |
| 232 | ) |
| 233 | result = pytester.runpytest(p) |
| 234 | result.stdout.fnmatch_lines( |
| 235 | [ |
| 236 | "*teardown_function*", |
| 237 | "*Captured stdout*", |
| 238 | "setup func1*", |
| 239 | "in func1*", |
| 240 | "teardown func1*", |
| 241 | # "*1 fixture failure*" |
| 242 | ] |
| 243 | ) |
| 244 | |
| 245 | def test_teardown_capturing_final(self, pytester: Pytester) -> None: |
| 246 | p = pytester.makepyfile( |
nothing calls this directly
no test coverage detected