(pytester: Pytester)
| 235 | |
| 236 | |
| 237 | def test_capturing(pytester: Pytester) -> None: |
| 238 | p = pytester.makepyfile( |
| 239 | """ |
| 240 | import pytest, sys |
| 241 | @pytest.fixture() |
| 242 | def one(): |
| 243 | sys.stdout.write('this should be captured') |
| 244 | sys.stderr.write('this should also be captured') |
| 245 | @pytest.fixture() |
| 246 | def two(one): |
| 247 | assert 0 |
| 248 | def test_capturing(two): |
| 249 | pass |
| 250 | """ |
| 251 | ) |
| 252 | |
| 253 | result = pytester.runpytest("--setup-only", p) |
| 254 | result.stdout.fnmatch_lines( |
| 255 | ["this should be captured", "this should also be captured"] |
| 256 | ) |
| 257 | |
| 258 | |
| 259 | def test_show_fixtures_and_execute_test(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected