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

numpy-svn@scip... numpy-svn@scip...
Sat Sep 13 13:15:40 CDT 2008


Author: alan.mcintyre
Date: 2008-09-13 13:15:38 -0500 (Sat, 13 Sep 2008)
New Revision: 5823

Modified:
   trunk/numpy/testing/noseclasses.py
Log:
Removed unused imports.
Fixed undefined reference to "getpackage" (from nose.util).


Modified: trunk/numpy/testing/noseclasses.py
===================================================================
--- trunk/numpy/testing/noseclasses.py	2008-09-13 18:10:48 UTC (rev 5822)
+++ trunk/numpy/testing/noseclasses.py	2008-09-13 18:15:38 UTC (rev 5823)
@@ -9,7 +9,7 @@
 from nose.plugins import doctests as npd
 from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin
 from nose.plugins.base import Plugin
-from nose.util import src, tolist
+from nose.util import src, getpackage
 import numpy
 from nosetester import get_package_name
 import inspect
@@ -79,10 +79,11 @@
         # doctests in extension modules.
 
         # Local shorthands
-        from inspect import isroutine, isclass, ismodule
+        from inspect import isroutine, isclass, ismodule, isfunction, \
+                            ismethod
 
         # Look for tests in a module's contained objects.
-        if inspect.ismodule(obj) and self._recurse:
+        if ismodule(obj) and self._recurse:
             for valname, val in obj.__dict__.items():
                 valname1 = '%s.%s' % (name, valname)
                 if ( (isroutine(val) or isclass(val))
@@ -93,7 +94,7 @@
 
 
         # Look for tests in a class's contained objects.
-        if inspect.isclass(obj) and self._recurse:
+        if isclass(obj) and self._recurse:
             #print 'RECURSE into class:',obj  # dbg
             for valname, val in obj.__dict__.items():
                 #valname1 = '%s.%s' % (name, valname)  # dbg
@@ -105,9 +106,8 @@
                     val = getattr(obj, valname).im_func
 
                 # Recurse to methods, properties, and nested classes.
-                if ((inspect.isfunction(val) or inspect.isclass(val) or
-                     inspect.ismethod(val) or
-                      isinstance(val, property)) and
+                if ((isfunction(val) or isclass(val) or
+                     ismethod(val) or isinstance(val, property)) and
                       self._from_module(module, val)):
                     valname = '%s.%s' % (name, valname)
                     self._find(tests, val, valname, module, source_lines,
@@ -175,7 +175,6 @@
     def configure(self, options, config):
         Plugin.configure(self, options, config)
         self.doctest_tests = True
-#        self.extension = tolist(options.doctestExtension)
         self.finder = NumpyDocTestFinder()
         self.parser = doctest.DocTestParser()
 



More information about the Numpy-svn mailing list