From caf33adab6af74ee539f0472d4204010671ea90a Mon Sep 17 00:00:00 2001 From: prettyboy Date: Thu, 7 Sep 2023 09:16:49 +0300 Subject: [library/python/pytest/plugins/ya] Limit snippet size up to 8kb --- library/python/pytest/plugins/ya.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'library/python/pytest/plugins') diff --git a/library/python/pytest/plugins/ya.py b/library/python/pytest/plugins/ya.py index 1129609c7cc..def3534d76c 100644 --- a/library/python/pytest/plugins/ya.py +++ b/library/python/pytest/plugins/ya.py @@ -882,10 +882,14 @@ class TraceReportGenerator(object): self._test_duration[test_item.nodeid] = test_item._duration @staticmethod - def _get_comment(test_item): + def _get_comment(test_item, limit=8*1024): msg = yatest_lib.tools.to_utf8(test_item.error) if not msg: return "" + + if len(msg) > limit: + msg = msg[:limit - 3] + "..." + return msg + "[[rst]]" def _dump_trace(self, name, value): -- cgit v1.3