(
self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
)
| 584 | |
| 585 | @parametrize_families |
| 586 | def test_failure_escape( |
| 587 | self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str |
| 588 | ) -> None: |
| 589 | pytester.makepyfile( |
| 590 | """ |
| 591 | import pytest |
| 592 | @pytest.mark.parametrize('arg1', "<&'", ids="<&'") |
| 593 | def test_func(arg1): |
| 594 | print(arg1) |
| 595 | assert 0 |
| 596 | """ |
| 597 | ) |
| 598 | result, dom = run_and_parse( |
| 599 | "-o", "junit_logging=system-out", family=xunit_family |
| 600 | ) |
| 601 | assert result.ret |
| 602 | node = dom.find_first_by_tag("testsuite") |
| 603 | node.assert_attr(failures=3, tests=3) |
| 604 | |
| 605 | for index, char in enumerate("<&'"): |
| 606 | |
| 607 | tnode = node.find_nth_by_tag("testcase", index) |
| 608 | tnode.assert_attr( |
| 609 | classname="test_failure_escape", name="test_func[%s]" % char |
| 610 | ) |
| 611 | sysout = tnode.find_first_by_tag("system-out") |
| 612 | text = sysout.text |
| 613 | assert "%s\n" % char in text |
| 614 | |
| 615 | @parametrize_families |
| 616 | def test_junit_prefixing( |
nothing calls this directly
no test coverage detected