summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_regression.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-08-01 20:29:36 +0000
committerCharles Harris <charlesr.harris@gmail.com>2017-08-05 10:36:48 -0600
commit2b781f8967488dc007f8f0a1e6a7f49208788d12 (patch)
tree88ad7478e033ce5980a365a479e22b78ba1cecaa /numpy/lib/tests/test_regression.py
parent5ab02b15de72fa00d785f49c62466fe048264cc4 (diff)
downloadnumpy-2b781f8967488dc007f8f0a1e6a7f49208788d12.tar.gz
MAINT/DOC: Use builtin when np.{x} is builtins.{x}.
This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
Diffstat (limited to 'numpy/lib/tests/test_regression.py')
-rw-r--r--numpy/lib/tests/test_regression.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/numpy/lib/tests/test_regression.py b/numpy/lib/tests/test_regression.py
index 1567219d6..74c47df7c 100644
--- a/numpy/lib/tests/test_regression.py
+++ b/numpy/lib/tests/test_regression.py
@@ -108,13 +108,13 @@ class TestRegression(object):
def test_polydiv_type(self):
# Make polydiv work for complex types
msg = "Wrong type, should be complex"
- x = np.ones(3, dtype=np.complex)
+ x = np.ones(3, dtype=complex)
q, r = np.polydiv(x, x)
- assert_(q.dtype == np.complex, msg)
+ assert_(q.dtype == complex, msg)
msg = "Wrong type, should be float"
- x = np.ones(3, dtype=np.int)
+ x = np.ones(3, dtype=int)
q, r = np.polydiv(x, x)
- assert_(q.dtype == np.float, msg)
+ assert_(q.dtype == float, msg)
def test_histogramdd_too_many_bins(self):
# Ticket 928.
@@ -123,11 +123,11 @@ class TestRegression(object):
def test_polyint_type(self):
# Ticket #944
msg = "Wrong type, should be complex"
- x = np.ones(3, dtype=np.complex)
- assert_(np.polyint(x).dtype == np.complex, msg)
+ x = np.ones(3, dtype=complex)
+ assert_(np.polyint(x).dtype == complex, msg)
msg = "Wrong type, should be float"
- x = np.ones(3, dtype=np.int)
- assert_(np.polyint(x).dtype == np.float, msg)
+ x = np.ones(3, dtype=int)
+ assert_(np.polyint(x).dtype == float, msg)
def test_ndenumerate_crash(self):
# Ticket 1140
@@ -234,7 +234,7 @@ class TestRegression(object):
def test_nansum_with_boolean(self):
# gh-2978
- a = np.zeros(2, dtype=np.bool)
+ a = np.zeros(2, dtype=bool)
try:
np.nansum(a)
except Exception: