From f36779d17c6f82a770cc945c99c63539810dd14c Mon Sep 17 00:00:00 2001
From: Xavier Robin <xavier.robin@unibas.ch>
Date: Tue, 15 Aug 2023 13:07:51 +0200
Subject: [PATCH] test: skip explicitly

---
 modules/bindings/tests/test_cadscore.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/bindings/tests/test_cadscore.py b/modules/bindings/tests/test_cadscore.py
index be3bab50d..c15996e2d 100644
--- a/modules/bindings/tests/test_cadscore.py
+++ b/modules/bindings/tests/test_cadscore.py
@@ -18,9 +18,8 @@ class TestCADBindings(unittest.TestCase):
       cad_read_g_path = settings.Locate('CADscore_read_global_scores.bash')  
       cad_read_l_path = settings.Locate('CADscore_read_local_scores.bash')
       executable_path = settings.Locate('voroprot2')
-    except:
-      print("Could not find CAD score classic executables: ignoring unit tests")
-      return
+    except settings.FileNotFound:
+      self.skipTest("Could not find CAD score classic executables: ignoring unit tests")
 
     cad_result = cadscore.CADScore(self.protein, self.protein, 
                                    label="cad_classic")
@@ -47,9 +46,8 @@ class TestCADBindings(unittest.TestCase):
       # all of the following need to be present
       voronota_cadscore_path = settings.Locate("voronota-cadscore")
       executable_path = settings.Locate("voronota")   
-    except:
-      print("Could not find CAD score voronota executables: ignoring unit tests")
-      return
+    except settings.FileNotFound:
+      self.skipTest("Could not find CAD score voronota executables: ignoring unit tests")
 
     cad_result = cadscore.CADScore(self.protein, self.protein, mode="voronota",
                                    label="cad_voronota")
-- 
GitLab