(
self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
)
| 401 | |
| 402 | @parametrize_families |
| 403 | def test_call_failure_teardown_error( |
| 404 | self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str |
| 405 | ) -> None: |
| 406 | pytester.makepyfile( |
| 407 | """ |
| 408 | import pytest |
| 409 | |
| 410 | @pytest.fixture |
| 411 | def arg(): |
| 412 | yield |
| 413 | raise Exception("Teardown Exception") |
| 414 | def test_function(arg): |
| 415 | raise Exception("Call Exception") |
| 416 | """ |
| 417 | ) |
| 418 | result, dom = run_and_parse(family=xunit_family) |
| 419 | assert result.ret |
| 420 | node = dom.get_first_by_tag("testsuite") |
| 421 | node.assert_attr(errors=1, failures=1, tests=2) |
| 422 | first, second = dom.find_by_tag("testcase") |
| 423 | assert first |
| 424 | assert second |
| 425 | assert first != second |
| 426 | fnode = first.get_first_by_tag("failure") |
| 427 | fnode.assert_attr(message="Exception: Call Exception") |
| 428 | snode = second.get_first_by_tag("error") |
| 429 | snode.assert_attr( |
| 430 | message='failed on teardown with "Exception: Teardown Exception"' |
| 431 | ) |
| 432 | |
| 433 | @parametrize_families |
| 434 | def test_skip_contains_name_reason( |
nothing calls this directly
no test coverage detected