'generate a TestSuite report from the collected TaskData and HostData'

def _generate_report(self):

    test_cases = []
    for (task_uuid, task_data) in self._task_data.items():
        for (host_uuid, host_data) in task_data.host_data.items():
            test_cases.append(self._build_test_case(task_data, host_data))
    test_suite = TestSuite(self._playbook_name, test_cases)
    report = TestSuite.to_xml_string([test_suite])
    output_file = os.path.join(self._output_dir, ('%s-%s.xml' % (self._playbook_name, time.time())))
    with open(output_file, 'wb') as xml:
        xml.write(to_bytes(report, errors='surrogate_or_strict'))
