(
self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
)
| 332 | |
| 333 | @parametrize_families |
| 334 | def test_call_failure_teardown_error( |
| 335 | self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str |
| 336 | ) -> None: |
| 337 | pytester.makepyfile( |
| 338 | """ |
| 339 | import pytest |
| 340 | |
| 341 | @pytest.fixture |
| 342 | def arg(): |
| 343 | yield |
| 344 | raise Exception("Teardown Exception") |
| 345 | def test_function(arg): |
| 346 | raise Exception("Call Exception") |
| 347 | """ |
| 348 | ) |
| 349 | result, dom = run_and_parse(family=xunit_family) |
| 350 | assert result.ret |
| 351 | node = dom.find_first_by_tag("testsuite") |
| 352 | node.assert_attr(errors=1, failures=1, tests=1) |
| 353 | first, second = dom.find_by_tag("testcase") |
| 354 | assert first |
| 355 | assert second |
| 356 | assert first != second |
| 357 | fnode = first.find_first_by_tag("failure") |
| 358 | fnode.assert_attr(message="Exception: Call Exception") |
| 359 | snode = second.find_first_by_tag("error") |
| 360 | snode.assert_attr( |
| 361 | message='failed on teardown with "Exception: Teardown Exception"' |
| 362 | ) |
| 363 | |
| 364 | @parametrize_families |
| 365 | def test_skip_contains_name_reason( |
nothing calls this directly
no test coverage detected