summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_regression.py11
-rw-r--r--numpy/distutils/tests/test_fcompiler_gnu.py2
-rw-r--r--numpy/doc/DISTUTILS.txt8
-rw-r--r--numpy/f2py/lib/__init__.py1
-rw-r--r--numpy/f2py/lib/parser/Fortran2003.py4
-rw-r--r--numpy/f2py/lib/parser/test_Fortran2003.py2
-rw-r--r--numpy/f2py/lib/tests/test_derived_scalar.py4
-rw-r--r--numpy/f2py/lib/tests/test_module_module.py4
-rw-r--r--numpy/f2py/lib/tests/test_module_scalar.py4
-rw-r--r--numpy/f2py/lib/tests/test_scalar_function_in.py4
-rw-r--r--numpy/f2py/lib/tests/test_scalar_in_out.py4
-rw-r--r--numpy/fft/tests/test_fftpack.py2
-rw-r--r--numpy/fft/tests/test_helper.py2
-rw-r--r--numpy/lib/tests/test_function_base.py9
-rw-r--r--numpy/linalg/tests/test_linalg.py4
-rw-r--r--numpy/linalg/tests/test_regression.py2
-rw-r--r--numpy/oldnumeric/tests/test_oldnumeric.py4
17 files changed, 29 insertions, 42 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index bec49b168..084307b43 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -807,9 +807,14 @@ class TestRegression(TestCase):
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"""
diff --git a/numpy/distutils/tests/test_fcompiler_gnu.py b/numpy/distutils/tests/test_fcompiler_gnu.py
index 8158bb749..3d727cd94 100644
--- a/numpy/distutils/tests/test_fcompiler_gnu.py
+++ b/numpy/distutils/tests/test_fcompiler_gnu.py
@@ -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'),
diff --git a/numpy/doc/DISTUTILS.txt b/numpy/doc/DISTUTILS.txt
index b1a50f376..b2027e619 100644
--- a/numpy/doc/DISTUTILS.txt
+++ b/numpy/doc/DISTUTILS.txt
@@ -477,15 +477,9 @@ a NumPy package module ``numpy.xxx.yyy`` containing a function
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):
diff --git a/numpy/f2py/lib/__init__.py b/numpy/f2py/lib/__init__.py
index c3b40cb76..90a4a5367 100644
--- a/numpy/f2py/lib/__init__.py
+++ b/numpy/f2py/lib/__init__.py
@@ -12,3 +12,4 @@ Author: Pearu Peterson <pearu@cens.ioc.ee>
Created: Oct 2006
-----
"""
+__test__ = False
diff --git a/numpy/f2py/lib/parser/Fortran2003.py b/numpy/f2py/lib/parser/Fortran2003.py
index 1df58638d..8242ab0a0 100644
--- a/numpy/f2py/lib/parser/Fortran2003.py
+++ b/numpy/f2py/lib/parser/Fortran2003.py
@@ -5826,7 +5826,7 @@ if 1: # Optimize subclass tree:
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 @@ for clsname, cls in Base_classes.items():
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]
diff --git a/numpy/f2py/lib/parser/test_Fortran2003.py b/numpy/f2py/lib/parser/test_Fortran2003.py
index 2e61a636d..3bf796b46 100644
--- a/numpy/f2py/lib/parser/test_Fortran2003.py
+++ b/numpy/f2py/lib/parser/test_Fortran2003.py
@@ -2056,7 +2056,7 @@ class TestContains(TestCase): # R1237
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
diff --git a/numpy/f2py/lib/tests/test_derived_scalar.py b/numpy/f2py/lib/tests/test_derived_scalar.py
index a7a93b07b..60c082171 100644
--- a/numpy/f2py/lib/tests/test_derived_scalar.py
+++ b/numpy/f2py/lib/tests/test_derived_scalar.py
@@ -15,9 +15,7 @@ Created: Oct 2006
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)
diff --git a/numpy/f2py/lib/tests/test_module_module.py b/numpy/f2py/lib/tests/test_module_module.py
index 0eec2f586..5a3fefa32 100644
--- a/numpy/f2py/lib/tests/test_module_module.py
+++ b/numpy/f2py/lib/tests/test_module_module.py
@@ -16,9 +16,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_module_ext2
diff --git a/numpy/f2py/lib/tests/test_module_scalar.py b/numpy/f2py/lib/tests/test_module_scalar.py
index e988a8e5f..acaae0517 100644
--- a/numpy/f2py/lib/tests/test_module_scalar.py
+++ b/numpy/f2py/lib/tests/test_module_scalar.py
@@ -15,9 +15,7 @@ Created: Oct 2006
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
diff --git a/numpy/f2py/lib/tests/test_scalar_function_in.py b/numpy/f2py/lib/tests/test_scalar_function_in.py
index ba8e23b48..bbc37d9f8 100644
--- a/numpy/f2py/lib/tests/test_scalar_function_in.py
+++ b/numpy/f2py/lib/tests/test_scalar_function_in.py
@@ -16,9 +16,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 = '''\
! -*- f77 -*-
diff --git a/numpy/f2py/lib/tests/test_scalar_in_out.py b/numpy/f2py/lib/tests/test_scalar_in_out.py
index c0f10be89..1ffd95f01 100644
--- a/numpy/f2py/lib/tests/test_scalar_in_out.py
+++ b/numpy/f2py/lib/tests/test_scalar_in_out.py
@@ -16,9 +16,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 fooint1(a)
diff --git a/numpy/fft/tests/test_fftpack.py b/numpy/fft/tests/test_fftpack.py
index 1e896b589..da15b8114 100644
--- a/numpy/fft/tests/test_fftpack.py
+++ b/numpy/fft/tests/test_fftpack.py
@@ -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)
diff --git a/numpy/fft/tests/test_helper.py b/numpy/fft/tests/test_helper.py
index 7239941e2..13006e2c0 100644
--- a/numpy/fft/tests/test_helper.py
+++ b/numpy/fft/tests/test_helper.py
@@ -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
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index c8555e82e..0be1a22b7 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1,4 +1,5 @@
import sys
+import warnings
from numpy.testing import *
import numpy.lib
@@ -425,8 +426,12 @@ class TestSinc(TestCase):
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)
diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py
index 4481e4831..441eede1a 100644
--- a/numpy/linalg/tests/test_linalg.py
+++ b/numpy/linalg/tests/test_linalg.py
@@ -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
diff --git a/numpy/linalg/tests/test_regression.py b/numpy/linalg/tests/test_regression.py
index c1b118770..ab101b7d0 100644
--- a/numpy/linalg/tests/test_regression.py
+++ b/numpy/linalg/tests/test_regression.py
@@ -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
diff --git a/numpy/oldnumeric/tests/test_oldnumeric.py b/numpy/oldnumeric/tests/test_oldnumeric.py
index e182a1a31..18c970235 100644
--- a/numpy/oldnumeric/tests/test_oldnumeric.py
+++ b/numpy/oldnumeric/tests/test_oldnumeric.py
@@ -1,3 +1,5 @@
+import unittest
+
from numpy.testing import *
from numpy import array
@@ -5,7 +7,7 @@ from numpy.oldnumeric import *
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)