(
self, pytester: Pytester, run_and_parse: RunAndParse, junit_logging: str
)
| 864 | |
| 865 | @pytest.mark.parametrize("junit_logging", ["no", "system-out"]) |
| 866 | def test_pass_captures_stdout( |
| 867 | self, pytester: Pytester, run_and_parse: RunAndParse, junit_logging: str |
| 868 | ) -> None: |
| 869 | pytester.makepyfile( |
| 870 | """ |
| 871 | def test_pass(): |
| 872 | print('hello-stdout') |
| 873 | """ |
| 874 | ) |
| 875 | _result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") |
| 876 | node = dom.get_first_by_tag("testsuite") |
| 877 | pnode = node.get_first_by_tag("testcase") |
| 878 | if junit_logging == "no": |
| 879 | assert not node.find_by_tag("system-out"), ( |
| 880 | "system-out should not be generated" |
| 881 | ) |
| 882 | if junit_logging == "system-out": |
| 883 | systemout = pnode.get_first_by_tag("system-out") |
| 884 | assert "hello-stdout" in systemout.toxml(), ( |
| 885 | "'hello-stdout' should be in system-out" |
| 886 | ) |
| 887 | |
| 888 | @pytest.mark.parametrize("junit_logging", ["no", "system-err"]) |
| 889 | def test_pass_captures_stderr( |
nothing calls this directly
no test coverage detected