diff options
author | Seth Troisi <sethtroisi@google.com> | 2019-10-01 03:16:53 -0700 |
---|---|---|
committer | Seth Troisi <sethtroisi@google.com> | 2019-10-01 03:29:41 -0700 |
commit | f4dfe833e3e037bb69113f7250fad3699f918cfc (patch) | |
tree | d59d2e551426a5c6b79e1f5cce8aaf8aeb2fb741 /numpy/core/tests | |
parent | 8fa7b6e73380d4b73251d8226d90f327996baa19 (diff) | |
download | numpy-f4dfe833e3e037bb69113f7250fad3699f918cfc.tar.gz |
Dep: Deprecation of float index in linespace
Diffstat (limited to 'numpy/core/tests')
-rw-r--r-- | numpy/core/tests/test_deprecations.py | 18 | ||||
-rw-r--r-- | numpy/core/tests/test_function_base.py | 5 |
2 files changed, 2 insertions, 21 deletions
diff --git a/numpy/core/tests/test_deprecations.py b/numpy/core/tests/test_deprecations.py index b12b71940..c5a0b101f 100644 --- a/numpy/core/tests/test_deprecations.py +++ b/numpy/core/tests/test_deprecations.py @@ -323,22 +323,6 @@ class TestArrayDataAttributeAssignmentDeprecation(_DeprecationTestCase): self.assert_deprecated(a.__setattr__, args=('data', b.data)) -class TestLinspaceInvalidNumParameter(_DeprecationTestCase): - """Argument to the num parameter in linspace that cannot be - safely interpreted as an integer is deprecated in 1.12.0. - - Argument to the num parameter in linspace that cannot be - safely interpreted as an integer should not be allowed. - In the interest of not breaking code that passes - an argument that could still be interpreted as an integer, a - DeprecationWarning will be issued for the time being to give - developers time to refactor relevant code. - """ - def test_float_arg(self): - # 2016-02-25, PR#7328 - self.assert_deprecated(np.linspace, args=(0, 10, 2.5)) - - class TestBinaryReprInsufficientWidthParameterForRepresentation(_DeprecationTestCase): """ If a 'width' parameter is passed into ``binary_repr`` that is insufficient to @@ -594,7 +578,7 @@ class Test_GetSet_NumericOps(_DeprecationTestCase): def test_get_numeric_ops(self): from numpy.core._multiarray_tests import getset_numericops self.assert_deprecated(getset_numericops, num=2) - + # empty kwargs prevents any state actually changing which would break # other tests. self.assert_deprecated(np.set_numeric_ops, kwargs={}) diff --git a/numpy/core/tests/test_function_base.py b/numpy/core/tests/test_function_base.py index 6f5709372..84b60b19c 100644 --- a/numpy/core/tests/test_function_base.py +++ b/numpy/core/tests/test_function_base.py @@ -236,10 +236,7 @@ class TestLinspace(object): def test_corner(self): y = list(linspace(0, 1, 1)) assert_(y == [0.0], y) - with suppress_warnings() as sup: - sup.filter(DeprecationWarning, ".*safely interpreted as an integer") - y = list(linspace(0, 1, 2.5)) - assert_(y == [0.0, 1.0]) + assert_raises(TypeError, linspace, 0, 1, num=2.5) def test_type(self): t1 = linspace(0, 1, 0).dtype |