From 1304541e9be2b3fd5deb396dcf5138283186b20a Mon Sep 17 00:00:00 2001
From: Dilawar Singh <dilawars@ncbs.res.in>
Date: Thu, 6 Sep 2018 16:17:27 +0530
Subject: [PATCH] On build service, if rdesigneur can not be imported, DO NOT
 RUN the test.

---
 moose-core/python/rdesigneur/rdesigneur.py | 7 +------
 moose-core/tests/python/test_rdesigneur.py | 7 ++++++-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/moose-core/python/rdesigneur/rdesigneur.py b/moose-core/python/rdesigneur/rdesigneur.py
index ba1515fc..c29f19cb 100644
--- a/moose-core/python/rdesigneur/rdesigneur.py
+++ b/moose-core/python/rdesigneur/rdesigneur.py
@@ -30,16 +30,11 @@ import matplotlib.pyplot as plt
 import rdesigneur.rmoogli as rmoogli
 from rdesigneur.rdesigneurProtos import *
 from moose.fixXreacs import fixXreacs
-#import fixXreacs
-#from . import fixXreacs
-#from rdesigneur.rmoogli import *
-#import rmoogli
-#from rdesigneurProtos import *
 
 from moose.neuroml.NeuroML import NeuroML
 from moose.neuroml.ChannelML import ChannelML
 
-# In python3, ElementTree is deprecated. We do not plan to support python <2.7
+# In python3, cElementTree is deprecated. We do not plan to support python <2.7
 # in future, so other imports have been removed.
 try:
   from lxml import etree
diff --git a/moose-core/tests/python/test_rdesigneur.py b/moose-core/tests/python/test_rdesigneur.py
index 28a92636..d89aa136 100644
--- a/moose-core/tests/python/test_rdesigneur.py
+++ b/moose-core/tests/python/test_rdesigneur.py
@@ -15,8 +15,13 @@ matplotlib.use('Agg')
 import matplotlib.pyplot as plt
 import numpy as np
 import moose
-import rdesigneur as rd 
 
+try:
+    import rdesigneur as rd 
+except RuntimeError as e:
+    print( "[WARN ] Could not import rdesigneur. Most likely due to DISPLAY issue." )
+    quit()
+    
 def test2( ):
     if moose.exists( '/model' ):
         moose.delete( '/model' )
-- 
GitLab