(capsys)
| 1205 | |
| 1206 | |
| 1207 | def 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)]) |
nothing calls this directly
no test coverage detected