From 2bada588ba57e46272fbe586826843fcb95ef571 Mon Sep 17 00:00:00 2001
From: fzahle <frza@dtu.dk>
Date: Thu, 27 Oct 2016 17:50:23 +0200
Subject: [PATCH] skip tests if test case directory is not present rather than
 fail

---
 ellipsyswrapper/testsuite.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ellipsyswrapper/testsuite.py b/ellipsyswrapper/testsuite.py
index bbe9c60..c381ff9 100644
--- a/ellipsyswrapper/testsuite.py
+++ b/ellipsyswrapper/testsuite.py
@@ -38,7 +38,7 @@ class CaseRunner(object):
         self.auxilaryfiles = []
         self.keep_directory = False
         self.test_restart = False
-        
+
         self.vars = []
 
         self.root_dir = os.getcwd()
@@ -274,6 +274,11 @@ class EllipSysTestCase(object):
 
         root_dir = os.getcwd()
 
+        # skip test if test case directory is not present
+        if not os.path.exists(os.path.join(root_dir,
+                                           self.casedict['directory'])):
+            raise unittest.SkipTest('Testcase directory not found')
+
         case = CaseRunner(self.casedict)
         if 'casename' not in self.casedict.keys():
             case.casename = self.__class__.__name__.split('.')[-1]
-- 
GitLab