from __future__ import division
-import errno
import logging
import os
def __init__(self, **kwargs):
super(RobotFramework, self).__init__(**kwargs)
- self.res_dir = os.path.join(self.dir_results, self.case_name)
self.xml_file = os.path.join(self.res_dir, 'output.xml')
def parse_results(self):
except KeyError:
self.__logger.exception("Mandatory args were not passed")
return self.EX_RUN_ERROR
- try:
- os.makedirs(self.res_dir)
- except OSError as ex:
- if ex.errno != errno.EEXIST:
+ if not os.path.exists(self.res_dir):
+ try:
+ os.makedirs(self.res_dir)
+ except Exception: # pylint: disable=broad-except
self.__logger.exception("Cannot create %s", self.res_dir)
return self.EX_RUN_ERROR
- except Exception: # pylint: disable=broad-except
- self.__logger.exception("Cannot create %s", self.res_dir)
- return self.EX_RUN_ERROR
stream = StringIO()
robot.run(*suites, variable=variable, variablefile=variablefile,
include=include, output=self.xml_file, log='NONE',
try:
self.parse_results()
self.__logger.info("Results were successfully parsed")
- assert self.generate_report() == 0
+ self.generate_report()
self.__logger.info("Results were successfully generated")
except RobotError as ex:
self.__logger.error("Run suites before publishing: %s", ex.message)