summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2017-08-06 17:22:20 -0500
committerGitHub <noreply@github.com>2017-08-06 17:22:20 -0500
commit91b06c021319faccb008a8ee485d26ae227bf079 (patch)
tree7195085d6bcaec87b5f2f0629c14456fcfa53d11 /numpy/lib/tests
parentf307cec3962926558b6387ebb4ab8d3f4ea3aa34 (diff)
parent351fe979580ab842cc5c04e1b616d3a64936a695 (diff)
downloadnumpy-91b06c021319faccb008a8ee485d26ae227bf079.tar.gz
Merge pull request #9522 from eric-wieser/stop-using-obj2sctype
BUG: Fix problems with obj2sctype
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_type_check.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_type_check.py b/numpy/lib/tests/test_type_check.py
index e05079981..8945b61ea 100644
--- a/numpy/lib/tests/test_type_check.py
+++ b/numpy/lib/tests/test_type_check.py
@@ -3,7 +3,7 @@ from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.compat import long
from numpy.testing import (
- assert_, assert_equal, assert_array_equal, run_module_suite
+ assert_, assert_equal, assert_array_equal, run_module_suite, assert_raises
)
from numpy.lib.type_check import (
common_type, mintypecode, isreal, iscomplex, isposinf, isneginf,
@@ -422,5 +422,11 @@ class TestArrayConversion(object):
assert_equal(a.__class__, np.ndarray)
assert_(np.issubdtype(a.dtype, np.floating))
+ # previously this would infer dtypes from arrays, unlike every single
+ # other numpy function
+ assert_raises(TypeError,
+ asfarray, np.array([1, 2, 3]), dtype=np.array(1.0))
+
+
if __name__ == "__main__":
run_module_suite()