MCPcopy Create free account
hub / github.com/bloomberg/pystack / test_print_thread

Function test_print_thread

tests/unit/test_traceback_formatter.py:1207–1230  ·  view source on GitHub ↗
(capsys)

Source from the content-addressed store, hash-verified

1205
1206
1207def test_print_thread(capsys):
1208 # GIVEN
1209 thread = PyThread(
1210 tid=1,
1211 frame=None,
1212 native_frames=[],
1213 holds_the_gil=False,
1214 is_gc_collecting=False,
1215 python_version=(3, 8),
1216 )
1217 # WHEN
1218
1219 with patch(
1220 "pystack.traceback_formatter.format_thread",
1221 return_value=("1", "2", "3"),
1222 ):
1223 print_thread(thread, NativeReportingMode.OFF)
1224
1225 # THEN
1226
1227 captured = capsys.readouterr()
1228
1229 assert captured.out == "1\n2\n3\n"
1230 assert captured.err == ""
1231
1232
1233@pytest.mark.parametrize("location_info", [(1, 0, 1, 0), (1, 1, 0, 0)])

Callers

nothing calls this directly

Calls 2

PyThreadClass · 0.90
print_threadFunction · 0.90

Tested by

no test coverage detected