Skip to content

Commit

Permalink
Fix for encode/decode in present_console_output
Browse files Browse the repository at this point in the history
Change-Id: Ifdc1c4aa2f9a9cadf9b813d5b67af2ebf4e04892
  • Loading branch information
Artur Spirin committed Aug 19, 2023
1 parent 3eb0b68 commit af1d2f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="test_junkie",
version="0.8a7",
version="0.8a8",
author="Artur Spirin",
author_email="[email protected]",
description="Modern Testing Framework",
Expand All @@ -24,6 +24,7 @@
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Quality Assurance",
Expand Down
27 changes: 18 additions & 9 deletions test_junkie/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,22 @@ def parse_exception(value):
for index in range(param_data["retry"]):
trace = param_data["tracebacks"][index]
if trace is not None:
trace = ":: Traceback: {}".format(
CliUtils.format_color_string(
parse_exception(
trace.encode('utf8', errors="replace").decode("unicode-escape")
), "red"
try:
trace = ":: Traceback: {}".format(
CliUtils.format_color_string(
parse_exception(
trace.encode('utf8', errors="replace")
), "red"
)
)
except:
trace = ":: Traceback: {}".format(
CliUtils.format_color_string(
parse_exception(
trace.encode("unicode_escape").decode("utf8")
), "red"
)
)
)
else:
trace = ""
print("\t |__ run #{num} [{status}] [{runtime:0.2f}s] {trace}"
Expand All @@ -346,9 +355,9 @@ def parse_exception(value):
runtime=param_data["performance"][index],
status=param_data["statuses"][index].upper()))
print("\n===========================================================")
print(". Test Junkie {} (Python{}) {} .".format(pkg_resources.require("test-junkie")[0].version,
sys.version_info[0],
DocumentationLinks.DOMAIN))
print(". Test Junkie {} (Python{}) {} .".format(
pkg_resources.require("test-junkie")[0].version, sys.version_info[0], DocumentationLinks.DOMAIN)
)
print("===========================================================")

@staticmethod
Expand Down

0 comments on commit af1d2f0

Please sign in to comment.