diff options
author | prettyboy <prettyboy@yandex-team.com> | 2023-01-20 16:33:46 +0300 |
---|---|---|
committer | prettyboy <prettyboy@yandex-team.com> | 2023-01-20 16:33:46 +0300 |
commit | c6a952a6e1eda08c6e1742ec1170691cec3670da (patch) | |
tree | b28ddb53b5ce194482167c04cadc532353b1193d /library/python/pytest/plugins | |
parent | 5c6ff1d7c6908ac41bcd7b4711c1396809d4b0a8 (diff) | |
download | ydb-c6a952a6e1eda08c6e1742ec1170691cec3670da.tar.gz |
[library/python/pytest] Better py3 colorization
Diffstat (limited to 'library/python/pytest/plugins')
-rw-r--r-- | library/python/pytest/plugins/ya.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/library/python/pytest/plugins/ya.py b/library/python/pytest/plugins/ya.py index 723904df92..e5d3ec09e5 100644 --- a/library/python/pytest/plugins/ya.py +++ b/library/python/pytest/plugins/ya.py @@ -617,19 +617,9 @@ def colorize(longrepr): return io.getvalue().strip() return yatest_lib.tools.to_utf8(longrepr) + # Use arcadia style colorization text = yatest_lib.tools.to_utf8(longrepr) - pos = text.find("E ") - if pos == -1: - return text - - bt, error = text[:pos], text[pos:] - filters = [ - # File path, line number and function name - (re.compile(r"^(.*?):(\d+): in (\S+)", flags=re.MULTILINE), r"[[unimp]]\1[[rst]]:[[alt2]]\2[[rst]]: in [[alt1]]\3[[rst]]"), - ] - for regex, substitution in filters: - bt = regex.sub(substitution, bt) - return "{}[[bad]]{}".format(bt, error) + return tools.colorize_pytest_error(text) class TestItem(object): |