aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/core/robotframework.py
diff options
context:
space:
mode:
authorDeepak Chandella <deepak.chandella@orange.com>2019-07-05 22:31:36 +0530
committerCédric Ollivier <cedric.ollivier@orange.com>2021-02-09 19:22:19 +0100
commit115092d35fdf9b449ff91e36cc2d668d39a8b257 (patch)
tree47105ccd2cede0686748031b7d42c6a705054269 /xtesting/core/robotframework.py
parenta707dbe72afa6398141d43135dc97ec32a40d412 (diff)
Adding first patch for behave feature
Change-Id: Ic975c301103b49cdec2bd26746b708388f21e892 Signed-off-by: Deepak Chandella <deepak.chandella@orange.com> (cherry picked from commit 5dd0d0ffd46e7665fddde8fd2f4da1a9b58506bb) (cherry picked from commit b7d72be6458dbe73e3893ba242fb2dd7a6c745fc)
Diffstat (limited to 'xtesting/core/robotframework.py')
-rw-r--r--xtesting/core/robotframework.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/xtesting/core/robotframework.py b/xtesting/core/robotframework.py
index c2fec56a..fa04454e 100644
--- a/xtesting/core/robotframework.py
+++ b/xtesting/core/robotframework.py
@@ -11,7 +11,6 @@
from __future__ import division
-import errno
import logging
import os
@@ -109,15 +108,12 @@ class RobotFramework(testcase.TestCase):
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',