Example #1
0
    def _invoke_exporters(self):
        # Add this logic into a ReportExporter(Runnable)
        # that will return a result containing errors
        if self.cfg.exporters is None:
            exporters = get_default_exporters(self.cfg)
        else:
            exporters = self.cfg.exporters

        for exporter in exporters:

            if hasattr(exporter, 'cfg'):
                exporter.cfg.parent = self.cfg

            if isinstance(exporter, test_exporters.Exporter):
                exp_result = ExporterResult.run_exporter(
                    exporter=exporter,
                    source=self._result.test_report,
                    type='test',
                )

                if not exp_result.success:
                    TESTPLAN_LOGGER.error(exp_result.traceback)
                self._result.exporter_results.append(exp_result)
            else:
                raise NotImplementedError('Exporter logic not'
                                          ' implemented for: {}'.format(
                                              type(exporter)))
Example #2
0
    def _invoke_exporters(self):
        # Add this logic into a ReportExporter(Runnable)
        # that will return a result containing errors

        if hasattr(self._result.test_report, "bubble_up_attachments"):
            self._result.test_report.bubble_up_attachments()

        for exporter in self.exporters:
            if isinstance(exporter, test_exporters.Exporter):
                exp_result = ExporterResult.run_exporter(
                    exporter=exporter,
                    source=self._result.test_report,
                    type="test",
                )

                if not exp_result.success:
                    logger.TESTPLAN_LOGGER.error(exp_result.traceback)
                self._result.exporter_results.append(exp_result)
            else:
                raise NotImplementedError(
                    "Exporter logic not implemented for: {}".format(
                        type(exporter)))