(
self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
)
| 350 | |
| 351 | @parametrize_families |
| 352 | def test_setup_error( |
| 353 | self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str |
| 354 | ) -> None: |
| 355 | pytester.makepyfile( |
| 356 | """ |
| 357 | import pytest |
| 358 | |
| 359 | @pytest.fixture |
| 360 | def arg(request): |
| 361 | raise ValueError("Error reason") |
| 362 | def test_function(arg): |
| 363 | pass |
| 364 | """ |
| 365 | ) |
| 366 | result, dom = run_and_parse(family=xunit_family) |
| 367 | assert result.ret |
| 368 | node = dom.get_first_by_tag("testsuite") |
| 369 | node.assert_attr(errors=1, tests=1) |
| 370 | tnode = node.get_first_by_tag("testcase") |
| 371 | tnode.assert_attr(classname="test_setup_error", name="test_function") |
| 372 | fnode = tnode.get_first_by_tag("error") |
| 373 | fnode.assert_attr(message='failed on setup with "ValueError: Error reason"') |
| 374 | assert "ValueError" in fnode.toxml() |
| 375 | |
| 376 | @parametrize_families |
| 377 | def test_teardown_error( |
nothing calls this directly
no test coverage detected