Skip to content

Commit 2ff895d

Browse files
authored
Merge pull request #27738 from mdhaber/gh24978
DEP: testing: disable deprecated use of keywords x/y
2 parents 63503c9 + f79470c commit 2ff895d

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

numpy/testing/_private/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,6 @@ def func_assert_same_pos(x, y, func=isnan, hasval='nan'):
892892
raise ValueError(msg)
893893

894894

895-
@_rename_parameter(['x', 'y'], ['actual', 'desired'], dep_version='2.0.0')
896895
def assert_array_equal(actual, desired, err_msg='', verbose=True, *,
897896
strict=False):
898897
"""
@@ -1022,7 +1021,6 @@ def assert_array_equal(actual, desired, err_msg='', verbose=True, *,
10221021
strict=strict)
10231022

10241023

1025-
@_rename_parameter(['x', 'y'], ['actual', 'desired'], dep_version='2.0.0')
10261024
def assert_array_almost_equal(actual, desired, decimal=6, err_msg='',
10271025
verbose=True):
10281026
"""
@@ -1378,10 +1376,10 @@ def check_support_sve(__cache=[]):
13781376
"""
13791377
gh-22982
13801378
"""
1381-
1379+
13821380
if __cache:
13831381
return __cache[0]
1384-
1382+
13851383
import subprocess
13861384
cmd = 'lscpu'
13871385
try:

numpy/testing/tests/test_utils.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,31 +1899,3 @@ def __del__(self):
18991899
finally:
19001900
# make sure that we stop creating reference cycles
19011901
ReferenceCycleInDel.make_cycle = False
1902-
1903-
1904-
@pytest.mark.parametrize('assert_func', [assert_array_equal,
1905-
assert_array_almost_equal])
1906-
def test_xy_rename(assert_func):
1907-
# Test that keywords `x` and `y` have been renamed to `actual` and
1908-
# `desired`, respectively. These tests and use of `_rename_parameter`
1909-
# decorator can be removed before the release of NumPy 2.2.0.
1910-
assert_func(1, 1)
1911-
assert_func(actual=1, desired=1)
1912-
1913-
assert_message = "Arrays are not..."
1914-
with pytest.raises(AssertionError, match=assert_message):
1915-
assert_func(1, 2)
1916-
with pytest.raises(AssertionError, match=assert_message):
1917-
assert_func(actual=1, desired=2)
1918-
1919-
dep_message = 'Use of keyword argument...'
1920-
with pytest.warns(DeprecationWarning, match=dep_message):
1921-
assert_func(x=1, desired=1)
1922-
with pytest.warns(DeprecationWarning, match=dep_message):
1923-
assert_func(1, y=1)
1924-
1925-
type_message = '...got multiple values for argument'
1926-
with (pytest.warns(DeprecationWarning, match=dep_message),
1927-
pytest.raises(TypeError, match=type_message)):
1928-
assert_func(1, x=1)
1929-
assert_func(1, 2, y=2)

0 commit comments

Comments
 (0)