summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2023-02-12 09:12:36 +0200
committerGitHub <noreply@github.com>2023-02-12 09:12:36 +0200
commit5c7fde654c7cc9d9f32f29f82f5cb034c3c3ccaa (patch)
tree9d21c3e3f62276dbd35303d49203ca4834ee1e09 /numpy/lib/tests/test_function_base.py
parent9dde0a930aa568bbdd3ba176b12d1d46c72d3d4e (diff)
parent9d5eafe596e75e30a85c01ed62bb5bea9389adc8 (diff)
downloadnumpy-5c7fde654c7cc9d9f32f29f82f5cb034c3c3ccaa.tar.gz
Merge pull request #23089 from seberg/numpy2-flag
API: Add environment variable for behavior planned in a 2.0
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index ecba35f2d..cc8003f61 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1217,6 +1217,13 @@ class TestGradient:
dfdx = gradient(f, x)
assert_array_equal(dfdx, [0.5, 0.5])
+ def test_return_type(self):
+ res = np.gradient(([1, 2], [2, 3]))
+ if np._using_numpy2_behavior():
+ assert type(res) is tuple
+ else:
+ assert type(res) is list
+
class TestAngle: