[Numpy-svn] r5343 - in trunk/numpy: core/tests distutils/tests doc f2py/lib f2py/lib/parser f2py/lib/tests fft/tests lib/tests linalg/tests oldnumeric/tests

numpy-svn@scip... numpy-svn@scip...
Thu Jul 3 03:44:10 CDT 2008


Author: rkern
Date: 2008-07-03 03:43:58 -0500 (Thu, 03 Jul 2008)
New Revision: 5343

Modified:
   trunk/numpy/core/tests/test_regression.py
   trunk/numpy/distutils/tests/test_fcompiler_gnu.py
   trunk/numpy/doc/DISTUTILS.txt
   trunk/numpy/f2py/lib/__init__.py
   trunk/numpy/f2py/lib/parser/Fortran2003.py
   trunk/numpy/f2py/lib/parser/test_Fortran2003.py
   trunk/numpy/f2py/lib/tests/test_derived_scalar.py
   trunk/numpy/f2py/lib/tests/test_module_module.py
   trunk/numpy/f2py/lib/tests/test_module_scalar.py
   trunk/numpy/f2py/lib/tests/test_scalar_function_in.py
   trunk/numpy/f2py/lib/tests/test_scalar_in_out.py
   trunk/numpy/fft/tests/test_fftpack.py
   trunk/numpy/fft/tests/test_helper.py
   trunk/numpy/lib/tests/test_function_base.py
   trunk/numpy/linalg/tests/test_linalg.py
   trunk/numpy/linalg/tests/test_regression.py
   trunk/numpy/oldnumeric/tests/test_oldnumeric.py
Log:
Clean up test output such that a completely-passing test suite has no extraneous output.

Modified: trunk/numpy/core/tests/test_regression.py
===================================================================
--- trunk/numpy/core/tests/test_regression.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/core/tests/test_regression.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -807,9 +807,14 @@
 
     def test_hist_bins_as_list(self, level=rlevel):
         """Ticket #632"""
-        hist,edges = np.histogram([1,2,3,4],[1,2])
-        assert_array_equal(hist,[1,3])
-        assert_array_equal(edges,[1,2])
+        import warnings
+        warnings.simplefilter('ignore', FutureWarning)
+        try:
+            hist,edges = np.histogram([1,2,3,4],[1,2])
+            assert_array_equal(hist,[1,3])
+            assert_array_equal(edges,[1,2])
+        finally:
+            warnings.resetwarnings()
 
     def test_copy_detection_zero_dim(self, level=rlevel):
         """Ticket #658"""

Modified: trunk/numpy/distutils/tests/test_fcompiler_gnu.py
===================================================================
--- trunk/numpy/distutils/tests/test_fcompiler_gnu.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/distutils/tests/test_fcompiler_gnu.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -1,8 +1,6 @@
 from numpy.testing import *
 
-set_package_path()
 import numpy.distutils.fcompiler
-restore_path()
 
 g77_version_strings = [
     ('GNU Fortran 0.5.25 20010319 (prerelease)', '0.5.25'),

Modified: trunk/numpy/doc/DISTUTILS.txt
===================================================================
--- trunk/numpy/doc/DISTUTILS.txt	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/doc/DISTUTILS.txt	2008-07-03 08:43:58 UTC (rev 5343)
@@ -477,15 +477,9 @@
   import sys
   from numpy.testing import *
 
-  set_package_path()
   # import xxx symbols
-  from xxx.yyy import zzz
-  restore_path()
+  from numpy.xxx.yyy import zzz
 
-  #Optional:
-  set_local_path()
-  # import modules that are located in the same directory as this file.
-  restore_path()
 
   class test_zzz(TestCase):
       def test_simple(self, level=1):

Modified: trunk/numpy/f2py/lib/__init__.py
===================================================================
--- trunk/numpy/f2py/lib/__init__.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/f2py/lib/__init__.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -12,3 +12,4 @@
 Created: Oct 2006
 -----
 """
+__test__ = False

Modified: trunk/numpy/f2py/lib/parser/Fortran2003.py
===================================================================
--- trunk/numpy/f2py/lib/parser/Fortran2003.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/f2py/lib/parser/Fortran2003.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -5826,7 +5826,7 @@
 
     def _rpl_list(clsname):
         if clsname not in Base_classes:
-            print 'Not implemented:',clsname
+            #print 'Not implemented:',clsname
             return [] # remove this code when all classes are implemented
         cls = Base_classes[clsname]
         if 'match' in cls.__dict__:
@@ -5868,7 +5868,7 @@
         else:
             print '%s not implemented needed by %s' % (n,clsname)
 
-if 1:
+if False:
     for cls in Base_classes.values():
         subclasses = Base.subclasses.get(cls.__name__,[])
         subclasses_names = [c.__name__ for c in subclasses]

Modified: trunk/numpy/f2py/lib/parser/test_Fortran2003.py
===================================================================
--- trunk/numpy/f2py/lib/parser/test_Fortran2003.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/f2py/lib/parser/test_Fortran2003.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -2056,7 +2056,7 @@
         assert_equal(str(a),'CONTAINS')
         assert_equal(repr(a),"Contains_Stmt('CONTAINS')")
 
-if 1:
+if False:
     nof_needed_tests = 0
     nof_needed_match = 0
     total_needs = 0

Modified: trunk/numpy/f2py/lib/tests/test_derived_scalar.py
===================================================================
--- trunk/numpy/f2py/lib/tests/test_derived_scalar.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/f2py/lib/tests/test_derived_scalar.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -15,9 +15,7 @@
 import os
 import sys
 from numpy.testing import *
-set_package_path()
-from lib.main import build_extension, compile
-restore_path()
+from numpy.f2py.lib.main import build_extension, compile
 
 fortran_code = '''
 subroutine foo(a)

Modified: trunk/numpy/f2py/lib/tests/test_module_module.py
===================================================================
--- trunk/numpy/f2py/lib/tests/test_module_module.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/f2py/lib/tests/test_module_module.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -16,9 +16,7 @@
 import sys
 from numpy.testing import *
 
-set_package_path()
-from lib.main import build_extension, compile
-restore_path()
+from numpy.f2py.lib.main import build_extension, compile
 
 fortran_code = '''
 module test_module_module_ext2

Modified: trunk/numpy/f2py/lib/tests/test_module_scalar.py
===================================================================
--- trunk/numpy/f2py/lib/tests/test_module_scalar.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/f2py/lib/tests/test_module_scalar.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -15,9 +15,7 @@
 import os
 import sys
 from numpy.testing import *
-set_package_path()
-from lib.main import build_extension, compile
-restore_path()
+from numpy.f2py.lib.main import build_extension, compile
 
 fortran_code = '''
 module test_module_scalar_ext

Modified: trunk/numpy/f2py/lib/tests/test_scalar_function_in.py
===================================================================
--- trunk/numpy/f2py/lib/tests/test_scalar_function_in.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/f2py/lib/tests/test_scalar_function_in.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -16,9 +16,7 @@
 import sys
 from numpy.testing import *
 
-set_package_path()
-from lib.main import build_extension, compile
-restore_path()
+from numpy.f2py.lib.main import build_extension, compile
 
 fortran_code = '''\
 ! -*- f77 -*-

Modified: trunk/numpy/f2py/lib/tests/test_scalar_in_out.py
===================================================================
--- trunk/numpy/f2py/lib/tests/test_scalar_in_out.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/f2py/lib/tests/test_scalar_in_out.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -16,9 +16,7 @@
 import sys
 from numpy.testing import *
 
-set_package_path()
-from lib.main import build_extension, compile
-restore_path()
+from numpy.f2py.lib.main import build_extension, compile
 
 fortran_code = '''
       subroutine fooint1(a)

Modified: trunk/numpy/fft/tests/test_fftpack.py
===================================================================
--- trunk/numpy/fft/tests/test_fftpack.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/fft/tests/test_fftpack.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -1,8 +1,6 @@
 import sys
 from numpy.testing import *
-set_package_path()
 import numpy as np
-restore_path()
 
 def fft1(x):
     L = len(x)

Modified: trunk/numpy/fft/tests/test_helper.py
===================================================================
--- trunk/numpy/fft/tests/test_helper.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/fft/tests/test_helper.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -5,9 +5,7 @@
 
 import sys
 from numpy.testing import *
-set_package_path()
 from numpy.fft import fftshift,ifftshift,fftfreq
-restore_path()
 
 from numpy import pi
 

Modified: trunk/numpy/lib/tests/test_function_base.py
===================================================================
--- trunk/numpy/lib/tests/test_function_base.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/lib/tests/test_function_base.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -1,4 +1,5 @@
 import sys
+import warnings
 
 from numpy.testing import *
 import numpy.lib
@@ -425,8 +426,12 @@
         assert_array_almost_equal(w,flipud(w),7)
 
 class TestHistogram(TestCase):
-    import warnings
-    warnings.simplefilter('ignore', FutureWarning)
+    def setUp(self):
+        warnings.simplefilter('ignore', FutureWarning)
+
+    def tearDown(self):
+        warnings.resetwarnings()
+
     def test_simple(self):
         n=100
         v=rand(n)

Modified: trunk/numpy/linalg/tests/test_linalg.py
===================================================================
--- trunk/numpy/linalg/tests/test_linalg.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/linalg/tests/test_linalg.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -2,12 +2,10 @@
 """
 
 from numpy.testing import *
-set_package_path()
 from numpy import array, single, double, csingle, cdouble, dot, identity
 from numpy import multiply, atleast_2d, inf, asarray, matrix
 from numpy import linalg
-from linalg import matrix_power
-restore_path()
+from numpy.linalg import matrix_power
 
 def ifthen(a, b):
     return not a or b

Modified: trunk/numpy/linalg/tests/test_regression.py
===================================================================
--- trunk/numpy/linalg/tests/test_regression.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/linalg/tests/test_regression.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -2,10 +2,8 @@
 """
 
 from numpy.testing import *
-set_package_path()
 import numpy as np
 from numpy import linalg, arange, float64, array, dot, transpose
-restore_path()
 
 rlevel = 1
 

Modified: trunk/numpy/oldnumeric/tests/test_oldnumeric.py
===================================================================
--- trunk/numpy/oldnumeric/tests/test_oldnumeric.py	2008-07-03 06:59:29 UTC (rev 5342)
+++ trunk/numpy/oldnumeric/tests/test_oldnumeric.py	2008-07-03 08:43:58 UTC (rev 5343)
@@ -1,3 +1,5 @@
+import unittest
+
 from numpy.testing import *
 
 from numpy import array
@@ -5,7 +7,7 @@
 from numpy.core.numeric import float32, float64, complex64, complex128, int8, \
         int16, int32, int64, uint, uint8, uint16, uint32, uint64
 
-class test_oldtypes(NumPyTestCase):
+class test_oldtypes(unittest.TestCase):
     def test_oldtypes(self, level=1):
         a1 = array([0,1,0], Float)
         a2 = array([0,1,0], float)



More information about the Numpy-svn mailing list