From f4d078c8beed53ef86d87f647869f2ff81b70254 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 25 Apr 2009 10:05:09 -0700 Subject: [PATCH] Fixing doctest EXCLUDES in iptest on win32. The regular expressions we were using on win32 were not matching. The trick is to construct the regular expression with double \\ like this:: re.compile('foo\\\\bar') Arggg!! --- IPython/testing/iptest.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index 32885b222..f5f760586 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -30,6 +30,7 @@ import warnings import nose.plugins.builtin from nose.core import TestProgram +from IPython.platutils import find_cmd from IPython.testing.plugin.ipdoctest import IPythonDoctest pjoin = path.join @@ -43,6 +44,7 @@ pjoin = path.join # modules, since this means untested code. As the testing machinery # solidifies, this list should eventually become empty. EXCLUDE = [pjoin('IPython', 'external'), + # This skip is duplicated below XXX pjoin('IPython', 'platutils_win32'), pjoin('IPython', 'frontend', 'cocoa'), pjoin('IPython', 'frontend', 'process', 'winprocess.py'), @@ -50,12 +52,28 @@ EXCLUDE = [pjoin('IPython', 'external'), pjoin('IPython', 'Gnuplot'), pjoin('IPython', 'Extensions', 'ipy_'), pjoin('IPython', 'Extensions', 'clearcmd'), - pjoin('IPython', 'Extensions', 'PhysicalQIn'), + pjoin('IPython', 'Extensions', 'PhysicalQInteractive'), pjoin('IPython', 'Extensions', 'scitedirector'), pjoin('IPython', 'Extensions', 'numeric_formats'), pjoin('IPython', 'testing', 'attic'), ] +try: + import wx +except ImportError: + EXCLUDE.append(pjoin('IPython', 'Extensions', 'igrid')) + +try: + import _curses +except ImportError: + EXCLUDE.append(pjoin('IPython', 'Extensions', 'ibrowse')) + + +# This is needed for the reg-exp to match on win32 in the ipdoctest plugin. +if sys.platform == 'win32': + EXCLUDE = [s.replace('\\','\\\\') for s in EXCLUDE] + + #----------------------------------------------------------------------------- # Functions and classes #----------------------------------------------------------------------------- @@ -125,7 +143,7 @@ class IPTester(object): if runner == 'iptest': self.runner = ['iptest','-v'] else: - self.runner = ['trial'] + self.runner = [find_cmd('trial')] if params is None: params = [] if isinstance(params,str):