Commit 5b57343f authored by Lakshmipathi Ganapathi's avatar Lakshmipathi Ganapathi Committed by Lakshmipathi Ganapathi
Browse files

Convert Decimals to String objects in YAML



By converting Decimal objects to Strings in Yaml, we ensure
that 'TestCase.metadata' field stored as a string in the
database. This helps YAML/CSV test result export more readable
and easy to parse.
Signed-off-by: Lakshmipathi Ganapathi's avatarLakshmipathi.G <lakshmipathi.ganapathi@collabora.co.uk>
parent d3d733b4
......@@ -49,6 +49,9 @@ elif sys.version_info[0] == 3:
from urllib.parse import quote
basestring = str
def yaml_decimal_str(dumper, value):
return yaml.ScalarNode(tag=u'tag:yaml.org,2002:str', value=str(value))
yaml.add_representer(decimal.Decimal, yaml_decimal_str)
def _check_for_testset(result_dict, suite):
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment