aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprettyboy <prettyboy@yandex-team.com>2023-09-07 09:16:49 +0300
committerprettyboy <prettyboy@yandex-team.com>2023-09-07 10:31:21 +0300
commitcaf33adab6af74ee539f0472d4204010671ea90a (patch)
tree840b2106eea254cddad435ddf11f569a858c5360
parent3cd71626b58f2e1958655ea8969d6878ddba51df (diff)
downloadydb-caf33adab6af74ee539f0472d4204010671ea90a.tar.gz
[library/python/pytest/plugins/ya] Limit snippet size up to 8kb
-rw-r--r--library/python/pytest/plugins/ya.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/python/pytest/plugins/ya.py b/library/python/pytest/plugins/ya.py
index 1129609c7c..def3534d76 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):