summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_utils.py
diff options
context:
space:
mode:
authorAaron Meurer <asmeurer@gmail.com>2021-06-14 14:07:18 -0600
committerAaron Meurer <asmeurer@gmail.com>2021-06-14 14:07:18 -0600
commit8c78b84968e580f24b3705378fb35705a434cdf1 (patch)
treec9f82beeb5a2c3f0301f7984d4b6d19539c35d23 /numpy/lib/tests/test_utils.py
parent8bf3a4618f1de951c7a4ccdb8bc3e36825a1b744 (diff)
parent75f852edf94a7293e7982ad516bee314d7187c2d (diff)
downloadnumpy-8c78b84968e580f24b3705378fb35705a434cdf1.tar.gz
Merge branch 'main' into matrix_rank-doc-fix
Diffstat (limited to 'numpy/lib/tests/test_utils.py')
-rw-r--r--numpy/lib/tests/test_utils.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_utils.py b/numpy/lib/tests/test_utils.py
index 33951b92a..8a877ae69 100644
--- a/numpy/lib/tests/test_utils.py
+++ b/numpy/lib/tests/test_utils.py
@@ -4,7 +4,7 @@ import pytest
from numpy.core import arange
from numpy.testing import assert_, assert_equal, assert_raises_regex
-from numpy.lib import deprecate
+from numpy.lib import deprecate, deprecate_with_doc
import numpy.lib.utils as utils
from io import StringIO
@@ -60,6 +60,11 @@ def old_func6(self, x):
new_func6 = deprecate(old_func6)
+@deprecate_with_doc(msg="Rather use new_func7")
+def old_func7(self,x):
+ return x
+
+
def test_deprecate_decorator():
assert_('deprecated' in old_func.__doc__)
@@ -73,6 +78,10 @@ def test_deprecate_fn():
assert_('new_func3' in new_func3.__doc__)
+def test_deprecate_with_doc_decorator_message():
+ assert_('Rather use new_func7' in old_func7.__doc__)
+
+
@pytest.mark.skipif(sys.flags.optimize == 2, reason="-OO discards docstrings")
@pytest.mark.parametrize('old_func, new_func', [
(old_func4, new_func4),