(
self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
)
| 307 | |
| 308 | @parametrize_families |
| 309 | def test_teardown_error( |
| 310 | self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str |
| 311 | ) -> None: |
| 312 | pytester.makepyfile( |
| 313 | """ |
| 314 | import pytest |
| 315 | |
| 316 | @pytest.fixture |
| 317 | def arg(): |
| 318 | yield |
| 319 | raise ValueError('Error reason') |
| 320 | def test_function(arg): |
| 321 | pass |
| 322 | """ |
| 323 | ) |
| 324 | result, dom = run_and_parse(family=xunit_family) |
| 325 | assert result.ret |
| 326 | node = dom.find_first_by_tag("testsuite") |
| 327 | tnode = node.find_first_by_tag("testcase") |
| 328 | tnode.assert_attr(classname="test_teardown_error", name="test_function") |
| 329 | fnode = tnode.find_first_by_tag("error") |
| 330 | fnode.assert_attr(message='failed on teardown with "ValueError: Error reason"') |
| 331 | assert "ValueError" in fnode.toxml() |
| 332 | |
| 333 | @parametrize_families |
| 334 | def test_call_failure_teardown_error( |
nothing calls this directly
no test coverage detected