Exemplo n.º 1
0
 def configure(self, options, config):
     """Configures the xunit plugin."""
     Plugin.configure(self, options, config)
     self.config = config
     if self.enabled:
         self.jinja = Environment(loader=FileSystemLoader(
             os.path.dirname(options.html_template)),
                                  trim_blocks=True,
                                  lstrip_blocks=True)
         self.stats = {
             'errors': 0,
             'failures': 0,
             'passes': 0,
             'skipped': 0
         }
         self.report_data = defaultdict(Group)
         htmlfile_dirname = os.path.dirname(options.html_file)
         if not os.path.exists(os.path.abspath(htmlfile_dirname)):
             os.makedirs(htmlfile_dirname)
         self.report_file = codecs.open(options.html_file, 'w',
                                        self.encoding, 'replace')
         self.report_template_filename = options.html_template