File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
allure-python-commons/src Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 55import json
66import uuid
77import shutil
8+
89from six import text_type
910from attr import asdict
1011from allure_commons import hookimpl
1112
13+ from allure_commons .model2 import TestResult
14+
1215INDENT = 4
1316
1417
@@ -32,6 +35,12 @@ def _report_item(self, item):
3235 indent = INDENT if os .environ .get ("ALLURE_INDENT_OUTPUT" ) else None
3336 filename = item .file_pattern .format (prefix = uuid .uuid4 ())
3437 data = asdict (item , filter = lambda attr , value : not (type (value ) != bool and not bool (value )))
38+
39+ if isinstance (item , TestResult ) and 'parameters' in data .keys ():
40+ for parameter in data ['parameters' ]:
41+ if isinstance (parameter ['value' ], dict ):
42+ parameter ['value' ] = json .dumps (parameter ['value' ])
43+
3544 with io .open (os .path .join (self ._report_dir , filename ), 'w' , encoding = 'utf8' ) as json_file :
3645 if sys .version_info .major < 3 :
3746 json_file .write (
You can’t perform that action at this time.
0 commit comments