(pytester: Pytester, junit_logging: str)
| 1091 | |
| 1092 | @pytest.mark.parametrize(class="st">"junit_logging", [class="st">"no", class="st">"system-out"]) |
| 1093 | def test_nullbyte_replace(pytester: Pytester, junit_logging: str) -> None: |
| 1094 | class="cm"># Check if the null byte gets replaced |
| 1095 | pytester.makepyfile( |
| 1096 | class="st">""" |
| 1097 | import sys |
| 1098 | def test_print_nullbyte(): |
| 1099 | sys.stdout.write(&class="cm">#x27;Here the null -->class="st">' + chr(0) + '<--') |
| 1100 | sys.stdout.write(&class="cm">#x27;In repr form -->class="st">' + repr(chr(0)) + '<--') |
| 1101 | assert False |
| 1102 | class="st">""" |
| 1103 | ) |
| 1104 | xmlf = pytester.path.joinpath(class="st">"junit.xml") |
| 1105 | pytester.runpytest(fclass="st">"--junitxml={xmlf}", class="st">"-o", fclass="st">"junit_logging={junit_logging}") |
| 1106 | text = xmlf.read_text(encoding=class="st">"utf-8") |
| 1107 | if junit_logging == class="st">"system-out": |
| 1108 | assert class="st">"class="cm">#x0" in text |
| 1109 | if junit_logging == class="st">"no": |
| 1110 | assert class="st">"class="cm">#x0" not in text |
| 1111 | |
| 1112 | |
| 1113 | def test_invalid_xml_escape() -> None: |
nothing calls this directly
no test coverage detected