Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profusion-mobi.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HweI2C03xaYqA86syd5G6Gl1Bi4TyzjSVCsMLGCk3NA=; b=UuwCFmQooF9Eb/HvVinGZO2lpx5pvpV0aH0f/MnYbxGL+EfZxVPIbzY8oxlyl2iqiW M17QkThEx0GI1MdeSVc9tZb6SA372jNOPziINO60ow8enDydYGW9wAHGYQ6D1k+oQxLX ufPaYqAAw8ymqOkV45IG/C4jThqeUOjUksuscTIc+9/+PF9UinV/AR02NE4D/Ts1W2Oc CpxKTPs2oZystvP1PaZny5ROpc/y8tpsBNSkg/T0AHqb+fODMqnCDV62rL42prODimv+ 8cmXD9i6VVPw2re0ATl0AubDxNYSQjT0z1Gi5xaTsAJZ8J7azmRXefoiWVh3wmzUNPHO loPg== From: Guilherme Campos Camargo Date: Wed, 2 May 2018 11:20:48 -0300 Message-Id: <20180502142052.29544-5-guicc@profusion.mobi> In-Reply-To: <20180502142052.29544-1-guicc@profusion.mobi> References: <20180502142052.29544-1-guicc@profusion.mobi> Subject: [Fuego] [PATCH 4/8] Catch PermissionError when saving screenshots List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org Also catch PermissionErrors when saving screenshot, along with FileNotFound errors. Signed-off-by: Guilherme Campos Camargo --- 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