8000 gh-101261: add test for function with > 255 args (#101262) · python/cpython@bd79039 · GitHub
[go: up one dir, main page]

Skip to content

Commit bd79039

Browse files
authored
gh-101261: add test for function with > 255 args (#101262)
1 parent 7b20a0f commit bd79039

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Lib/test/test_call.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,16 @@ def c_py_recurse(m):
934934
finally:
935935
sys.setrecursionlimit(depth)
936936

937+
class TestFunctionWithManyArgs(unittest.TestCase):
938+
def test_function_with_many_args(self):
939+
for N in (10, 500, 1000):
940+
with self.subTest(N=N):
941+
args = ",".join([f"a{i}" for i in range(N)])
942+
src = f"def f({args}) : return a{N//2}"
943+
l = {}
944+
exec(src, {}, l)
945+
self.assertEqual(l['f'](*range(N)), N//2)
946+
937947

938948
if __name__ == "__main__":
939949
unittest.main()

0 commit comments

Comments
 (0)
0