summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_regression.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests/test_regression.py')
-rw-r--r--numpy/lib/tests/test_regression.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/numpy/lib/tests/test_regression.py b/numpy/lib/tests/test_regression.py
index a67355957..ea4d75f6b 100644
--- a/numpy/lib/tests/test_regression.py
+++ b/numpy/lib/tests/test_regression.py
@@ -70,8 +70,8 @@ class TestRegression(TestCase):
"""Ticket #554"""
x = np.poly1d([1,2,3])
y = np.poly1d([3,4])
- assert x != y
- assert x == x
+ assert_(x != y)
+ assert_(x == x)
def test_mem_insert(self, level=rlevel):
"""Ticket #572"""
@@ -152,34 +152,34 @@ class TestRegression(TestCase):
def test_void_coercion(self, level=rlevel):
dt = np.dtype([('a','f4'),('b','i4')])
x = np.zeros((1,),dt)
- assert(np.r_[x,x].dtype == dt)
+ assert_(np.r_[x,x].dtype == dt)
def test_who_with_0dim_array(self, level=rlevel) :
"""ticket #1243"""
import os, sys
+ oldstdout = sys.stdout
sys.stdout = open(os.devnull, 'w')
- try :
- tmp = np.who({'foo' : np.array(1)})
- sys.stdout = sys.__stdout__
- except :
- sys.stdout = sys.__stdout__
- raise AssertionError("ticket #1243")
+ try:
+ try:
+ tmp = np.who({'foo' : np.array(1)})
+ except:
+ raise AssertionError("ticket #1243")
+ finally:
+ sys.stdout = oldstdout
def test_bincount_empty(self):
"""Ticket #1387: empty array as input for bincount."""
assert_raises(ValueError, lambda : np.bincount(np.array([], dtype=np.intp)))
- @dec.deprecated()
def test_include_dirs(self):
"""As a sanity check, just test that get_include and
get_numarray_include include something reasonable. Somewhat
related to ticket #1405."""
- include_dirs = [np.get_include(), np.get_numarray_include(),
- np.get_numpy_include()]
+ include_dirs = [np.get_include(), np.get_numarray_include()]
for path in include_dirs:
- assert isinstance(path, (str, unicode))
- assert path != ''
+ assert_(isinstance(path, (str, unicode)))
+ assert_(path != '')
def test_polyder_return_type(self):
"""Ticket #1249"""