(self, pytester: Pytester)
| 572 | |
| 573 | class TestFixtureReporting: |
| 574 | def test_setup_fixture_error(self, pytester: Pytester) -> None: |
| 575 | pytester.makepyfile( |
| 576 | """ |
| 577 | def setup_function(function): |
| 578 | print("setup func") |
| 579 | assert 0 |
| 580 | def test_nada(): |
| 581 | pass |
| 582 | """ |
| 583 | ) |
| 584 | result = pytester.runpytest() |
| 585 | result.stdout.fnmatch_lines( |
| 586 | [ |
| 587 | "*ERROR at setup of test_nada*", |
| 588 | "*setup_function(function):*", |
| 589 | "*setup func*", |
| 590 | "*assert 0*", |
| 591 | "*1 error*", |
| 592 | ] |
| 593 | ) |
| 594 | assert result.ret != 0 |
| 595 | |
| 596 | def test_teardown_fixture_error(self, pytester: Pytester) -> None: |
| 597 | pytester.makepyfile( |
nothing calls this directly
no test coverage detected