summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-06-01 18:08:04 +0100
committerGitHub <noreply@github.com>2019-06-01 18:08:04 +0100
commitcd74e66a8c420be675fd2fbf3fe708ac02ee9f21 (patch)
tree12f985512507967c339019c4c21b4a613cd6c61b /Lib/test
parent059b9ea5ac98f432e41b05d1fa5aab4ffa22df4d (diff)
downloadcpython-git-cd74e66a8c420be675fd2fbf3fe708ac02ee9f21.tar.gz
bpo-37122: Make co->co_argcount represent the total number of positonal arguments in the code object (GH-13726)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_code.py2
-rw-r--r--Lib/test/test_dis.py2
-rw-r--r--Lib/test/test_positional_only_arg.py4
3 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 91008c04f7..0d80af44d9 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -112,7 +112,7 @@ consts: ('None',)
>>> dump(posonly_args.__code__)
name: posonly_args
-argcount: 1
+argcount: 3
posonlyargcount: 2
kwonlyargcount: 0
names: ()
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index 1561021f5b..652af45d55 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -640,7 +640,7 @@ def tricky(a, b, /, x, y, z=True, *args, c, d, e=[], **kwds):
code_info_tricky = """\
Name: tricky
Filename: (.*)
-Argument count: 3
+Argument count: 5
Positional-only arguments: 2
Kw-only arguments: 3
Number of locals: 10
diff --git a/Lib/test/test_positional_only_arg.py b/Lib/test/test_positional_only_arg.py
index 0aaad84cb3..59b0b8fb55 100644
--- a/Lib/test/test_positional_only_arg.py
+++ b/Lib/test/test_positional_only_arg.py
@@ -100,14 +100,14 @@ class PositionalOnlyTestCase(unittest.TestCase):
def f(a, b, c, /, d, e=1, *, f, g=2):
pass
- self.assertEqual(2, f.__code__.co_argcount) # 2 "standard args"
+ self.assertEqual(5, f.__code__.co_argcount) # 3 posonly + 2 "standard args"
self.assertEqual(3, f.__code__.co_posonlyargcount)
self.assertEqual((1,), f.__defaults__)
def f(a, b, c=1, /, d=2, e=3, *, f, g=4):
pass
- self.assertEqual(2, f.__code__.co_argcount) # 2 "standard args"
+ self.assertEqual(5, f.__code__.co_argcount) # 3 posonly + 2 "standard args"
self.assertEqual(3, f.__code__.co_posonlyargcount)
self.assertEqual((1, 2, 3), f.__defaults__)