From 89b777561960968bca01bc0ba255f1ad2c7d61f4 Mon Sep 17 00:00:00 2001
From: Tobias Schmidt <tobias.schmidt@unibas.ch>
Date: Thu, 8 Mar 2012 17:16:30 +0100
Subject: [PATCH] TableClass: ignore one unittest if scipy.stats.mstats is not
 available (fixes BZDNG-315)

---
 modules/base/pymod/table.py      | 4 +++-
 modules/base/tests/test_table.py | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/base/pymod/table.py b/modules/base/pymod/table.py
index 6eea1f010..6cc878fd9 100644
--- a/modules/base/pymod/table.py
+++ b/modules/base/pymod/table.py
@@ -1156,6 +1156,8 @@ class Table(object):
     taking rows into account where both of the values are not equal to None. If 
     there are not enough data points to calculate a correlation coefficient, 
     None is returned.
+    
+    The function depends on the following module: *scipy.stats.mstats*
     """
     try:
       import scipy.stats.mstats
@@ -1177,7 +1179,7 @@ class Table(object):
         return None
 
     except ImportError:
-      LogError("Function needs scipy, but I could not import it.")
+      LogError("Function needs scipy.stats.mstats, but I could not import it.")
       raise
     
 
diff --git a/modules/base/tests/test_table.py b/modules/base/tests/test_table.py
index ea823869c..7091106f5 100644
--- a/modules/base/tests/test_table.py
+++ b/modules/base/tests/test_table.py
@@ -20,10 +20,10 @@ except ImportError:
   print "Could not find numpy: ignoring some table class unit tests"
 
 try:
-  import scipy
+  import scipy.stats.mstats
 except ImportError:
   HAS_SCIPY=False
-  print "Could not find scipy: ignoring some table class unit tests"
+  print "Could not find scipy.stats.mstats: ignoring some table class unit tests"
   
 try:
   import matplotlib
-- 
GitLab