MCPcopy Create free account
hub / github.com/microsoft/debugpy / test_non_ascii_output

Function test_non_ascii_output

tests/debugpy/test_output.py:147–172  ·  view source on GitHub ↗
(pyfile, target, run)

Source from the content-addressed store, hash-verified

145
146
147def 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
175if sys.platform == "win32":

Callers

nothing calls this directly

Calls 6

set_breakpointsMethod · 0.80
wait_for_stopMethod · 0.80
request_continueMethod · 0.80
outputMethod · 0.80
runFunction · 0.70
targetFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…