mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-101261: add test for function with > 255 args (#101262)
This commit is contained in:
parent
7b20a0f55a
commit
bd7903967c
1 changed files with 10 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue