From ee268defef9670733951edb61564b6bbf44dd9c0 2012-05-31 20:25:03 From: Fernando Perez Date: 2012-05-31 20:25:03 Subject: [PATCH] Ensure that no tests are attempted if numpy or rpy2 are not present. This prevents both importing of the extension itself and running of the test suite. --- diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index 5df454d..3fbff9c 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -143,16 +143,17 @@ have = {} have['curses'] = test_for('_curses') have['matplotlib'] = test_for('matplotlib') +have['numpy'] = test_for('numpy') have['pexpect'] = test_for('IPython.external.pexpect') have['pymongo'] = test_for('pymongo') have['pygments'] = test_for('pygments') -have['wx'] = test_for('wx') -have['wx.aui'] = test_for('wx.aui') have['qt'] = test_for('IPython.external.qt') +have['rpy2'] = test_for('rpy2') have['sqlite3'] = test_for('sqlite3') have['cython'] = test_for('Cython') - have['tornado'] = test_for('tornado.version_info', (2,1,0), callback=None) +have['wx'] = test_for('wx') +have['wx.aui'] = test_for('wx.aui') if os.name == 'nt': min_zmq = (2,1,7) @@ -275,6 +276,10 @@ def make_exclude(): if not have['tornado']: exclusions.append(ipjoin('frontend', 'html')) + if not have['rpy2'] or not have['numpy']: + exclusions.append(ipjoin('extensions', 'rmagic')) + exclusions.append(ipjoin('extensions', 'tests', 'test_rmagic')) + # This is needed for the reg-exp to match on win32 in the ipdoctest plugin. if sys.platform == 'win32': exclusions = [s.replace('\\','\\\\') for s in exclusions]