(pyfile, target, run)
| 145 | |
| 146 | |
| 147 | def test_non_ascii_output(pyfile, target, run): |
| 148 | @pyfile |
| 149 | def code_to_debug(): |
| 150 | import debuggee |
| 151 | import sys |
| 152 | |
| 153 | debuggee.setup() |
| 154 | a = b"\xc3\xa9 \xc3\xa0 \xc3\xb6 \xc3\xb9\n" |
| 155 | sys.stdout.buffer.write(a) |
| 156 | x = 4 # @wait_for_output |
| 157 | |
| 158 | with debug.Session() as session: |
| 159 | session.config["redirectOutput"] = True |
| 160 | |
| 161 | with run(session, target(code_to_debug)): |
| 162 | session.set_breakpoints(code_to_debug, all) |
| 163 | |
| 164 | session.wait_for_stop() |
| 165 | session.request_continue() |
| 166 | |
| 167 | output = session.output("stdout").encode("utf-8", "replace") |
| 168 | |
| 169 | assert output in ( |
| 170 | b"\xc3\xa9 \xc3\xa0 \xc3\xb6 \xc3\xb9\n", |
| 171 | b"\xc3\x83\xc2\xa9 \xc3\x83\xc2\xa0 \xc3\x83\xc2\xb6 \xc3\x83\xc2\xb9\n", |
| 172 | ) |
| 173 | |
| 174 | |
| 175 | if sys.platform == "win32": |
nothing calls this directly
no test coverage detected
searching dependent graphs…