[Numpy-svn] r5451 - trunk/numpy/testing

numpy-svn@scip... numpy-svn@scip...
Fri Jul 18 08:00:32 CDT 2008


Author: alan.mcintyre
Date: 2008-07-18 08:00:29 -0500 (Fri, 18 Jul 2008)
New Revision: 5451

Modified:
   trunk/numpy/testing/noseclasses.py
   trunk/numpy/testing/nosetester.py
Log:
Comment cleanup.
Fixed __import__ calls for Python 2.4 (__import__ doesn't take keyword args in 2.4).


Modified: trunk/numpy/testing/noseclasses.py
===================================================================
--- trunk/numpy/testing/noseclasses.py	2008-07-18 12:32:27 UTC (rev 5450)
+++ trunk/numpy/testing/noseclasses.py	2008-07-18 13:00:29 UTC (rev 5451)
@@ -178,7 +178,7 @@
         self.finder = numpyDocTestFinder()
         self.parser = doctest.DocTestParser()
 
-    # Turns on whitespace normalization, set a minimal execution context
+    # Turn on whitespace normalization, set a minimal execution context
     # for doctests, implement a "#random" directive to allow executing a
     # command while ignoring its output.
     def loadTestsFromModule(self, module):
@@ -221,7 +221,7 @@
                 p = pkg_name.split('.')
                 p1 = '.'.join(p[:-1])
                 p2 = p[-1]
-                test.globs[p2] = __import__(pkg_name, fromlist=[p2])
+                test.globs[p2] = __import__(pkg_name, test.globs, {}, [p2])
                     
                 print 'additional import for %s: from %s import %s' % (test.filename, p1, p2)
                 print '    (%s): %r' % (pkg_name, test.globs[p2])
@@ -240,8 +240,7 @@
         numpy.set_printoptions(**print_state)
 
 
-    # Implement a wantFile method so that we can ignore NumPy-specific 
-    # build files that shouldn't be searched for tests
+    # Ignore NumPy-specific build files that shouldn't be searched for tests
     def wantFile(self, file):
         bn = os.path.basename(file)
         if bn in _doctest_ignore:

Modified: trunk/numpy/testing/nosetester.py
===================================================================
--- trunk/numpy/testing/nosetester.py	2008-07-18 12:32:27 UTC (rev 5450)
+++ trunk/numpy/testing/nosetester.py	2008-07-18 13:00:29 UTC (rev 5451)
@@ -236,7 +236,7 @@
         from noseclasses import numpyDoctest
         plugins = [numpyDoctest(), ]
         for m, p in nose.plugins.builtin.builtins:
-            mod = __import__(m,fromlist=[p])
+            mod = __import__(m,globals(),{},[p])
             plug = getattr(mod, p)
             plugins.append(plug())
 



More information about the Numpy-svn mailing list