

def feature(self, feature):
    if ((feature.status == 'skipped') and (not self.show_skipped)):
        return
    feature_filename = self.make_feature_filename(feature)
    classname = feature_filename
    report = FeatureReportData(feature, feature_filename)
    suite = ElementTree.Element('testsuite')
    feature_name = (feature.name or feature_filename)
    suite.set('name', ('%s.%s' % (classname, feature_name)))
    for scenario in feature:
        if isinstance(scenario, ScenarioOutline):
            scenario_outline = scenario
            self._process_scenario_outline(scenario_outline, report)
        else:
            self._process_scenario(scenario, report)
    for testcase in report.testcases:
        suite.append(testcase)
    suite.set('tests', _text(report.counts_tests))
    suite.set('errors', _text(report.counts_errors))
    suite.set('failures', _text(report.counts_failed))
    suite.set('skipped', _text(report.counts_skipped))
    suite.set('time', _text(round(feature.duration, 6)))
    if (not os.path.exists(self.config.junit_directory)):
        os.makedirs(self.config.junit_directory)
    tree = ElementTreeWithCDATA(suite)
    report_dirname = self.config.junit_directory
    report_basename = ('TESTS-%s.xml' % feature_filename)
    report_filename = os.path.join(report_dirname, report_basename)
    tree.write(codecs.open(report_filename, 'wb'), 'UTF-8')

dataset/ETHPy150Open behave/behave/behave/reporter/junit.py JUnitReporter.feature/original