@@ -21,12 +21,7 @@ def __init__(self, report_dir, clean=False):
2121 def _report_item (self , item ):
2222 indent = INDENT if os .environ .get ("ALLURE_INDENT_OUTPUT" ) else None
2323 filename = item .file_pattern .format (prefix = uuid .uuid4 ())
24- data = asdict (
25- item ,
26- filter = lambda attr , value : not (
27- type (value ) != bool and not bool (value )
28- )
29- )
24+ data = asdict (item , filter = lambda _ , v : v or v is False )
3025 with io .open (self ._report_dir / filename , 'w' , encoding = 'utf8' ) as json_file :
3126 json .dump (data , json_file , indent = indent , ensure_ascii = False )
3227
@@ -62,12 +57,12 @@ def __init__(self):
6257
6358 @hookimpl
6459 def report_result (self , result ):
65- data = asdict (result , filter = lambda attr , value : not ( type ( value ) != bool and not bool ( value )) )
60+ data = asdict (result , filter = lambda _ , v : v or v is False )
6661 self .test_cases .append (data )
6762
6863 @hookimpl
6964 def report_container (self , container ):
70- data = asdict (container , filter = lambda attr , value : not ( type ( value ) != bool and not bool ( value )) )
65+ data = asdict (container , filter = lambda _ , v : v or v is False )
7166 self .test_containers .append (data )
7267
7368 @hookimpl
0 commit comments