Skip to content

Commit 1aaa1fd

Browse files
committed
Fix __index__ tests in test_signatures.py
1 parent 87bc8b5 commit 1aaa1fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

array_api_tests/test_signatures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def test_function_positional_args(name):
135135
# written in pure Python (e.g., it won't work for numpy ufuncs).
136136

137137
dtype = None
138-
if (name.startswith('__i') and name not in ['__int__', '__invert__']
138+
if (name.startswith('__i') and name not in ['__int__', '__invert__', '__index__']
139139
or name.startswith('__r') and name != '__rshift__'):
140140
n = operators_to_functions[name[:2] + name[3:]]
141141
else:
@@ -148,7 +148,7 @@ def test_function_positional_args(name):
148148
if array_method(name):
149149
if name == '__bool__':
150150
_mod = ones((), dtype=bool)
151-
elif name == '__int__':
151+
elif name in ['__int__', '__index__']:
152152
_mod = ones((), dtype=int64)
153153
elif name == '__float__':
154154
_mod = ones((), dtype=float64)

0 commit comments

Comments
 (0)