aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_call.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_call.py')
-rw-r--r--Lib/test/test_call.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py
index c17528be97b..aab7b1580ea 100644
--- a/Lib/test/test_call.py
+++ b/Lib/test/test_call.py
@@ -934,6 +934,16 @@ class TestRecursion(unittest.TestCase):
finally:
sys.setrecursionlimit(depth)
+class TestFunctionWithManyArgs(unittest.TestCase):
+ def test_function_with_many_args(self):
+ for N in (10, 500, 1000):
+ with self.subTest(N=N):
+ args = ",".join([f"a{i}" for i in range(N)])
+ src = f"def f({args}) : return a{N//2}"
+ l = {}
+ exec(src, {}, l)
+ self.assertEqual(l['f'](*range(N)), N//2)
+
if __name__ == "__main__":
unittest.main()