8000 TST: Add minimal test to cover many-argument path · numpy/numpy@6b6b791 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b6b791

Browse files
committed
TST: Add minimal test to cover many-argument path
1 parent 6cf3ee6 commit 6b6b791

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

numpy/core/tests/test_argparse.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,12 @@ def test_string_fallbacks():
6060
match="got an unexpected keyword argument 'missing_arg'"):
6161
func(2, **{missing_arg: 3})
6262

63+
64+
def test_too_many_arguments_method_forwarding():
65+
# Not directly related to the standard argument parsing, but we sometimes
66+
# forward methods to Python: arr.mean() calls np.core._methods._mean()
67+
# This adds code coverage for this `npy_forward_method`.
68+
arr = np.arange(3)
69+
args = range(1000)
70+
with pytest.raises(TypeError):
71+
arr.mean(*args)

0 commit comments

Comments
 (0)
0