Skip to content

Commit 896c5a2

Browse files
Jonas Trappenbergdnozay
authored andcommitted
Include filenames in test report
1 parent 96bb4c3 commit 896c5a2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

xmlrunner/result.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,12 @@ def _report_testsuite(suite_name, tests, xml_document, parentElement,
460460
"""
461461
testsuite = xml_document.createElement('testsuite')
462462
parentElement.appendChild(testsuite)
463+
module_name = suite_name.rpartition('.')[0]
464+
file_name = module_name.replace('.', '/') + '.py'
463465

464466
testsuite.setAttribute('name', suite_name)
465467
testsuite.setAttribute('tests', str(len(tests)))
468+
testsuite.setAttribute('file', file_name)
466469

467470
testsuite.setAttribute(
468471
'time', '%.3f' % sum(map(lambda e: e.elapsed_time, tests))

0 commit comments

Comments
 (0)