[Fuego] [PATCH 4/8] Catch PermissionError when saving screenshots

Guilherme Campos Camargo guicc at profusion.mobi
Wed May 2 14:20:48 UTC 2018


Also catch PermissionErrors when saving screenshot, along with
FileNotFound errors.

Signed-off-by: Guilherme Campos Camargo <guicc at profusion.mobi>
---
 engine/tests/Functional.fuego_release_test/test_run.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/engine/tests/Functional.fuego_release_test/test_run.py b/engine/tests/Functional.fuego_release_test/test_run.py
index 9b96d0d..4013378 100755
--- a/engine/tests/Functional.fuego_release_test/test_run.py
+++ b/engine/tests/Functional.fuego_release_test/test_run.py
@@ -315,10 +315,11 @@ class CheckScreenshot(SeleniumCommand):
 
         try:
             screenshot.save(self.test_img_path, format='PNG')
-        except FileNotFoundError:
+        except (FileNotFoundError, PermissionError) as e:
             LOGGER.error(
-                "  Unable to save the screenshot to '%s'. Does the directory "
-                "exist and can you write to it?", self.test_img_path)
+                "  Unable to save the screenshot to '%s'. Does the " +
+                " directory exist and can you write to it? Error: %s",
+                self.test_img_path, e)
             return False
 
         result = self.compare_images(self.test_img_path,
-- 
2.17.0



More information about the Fuego mailing list