summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-03-27 22:42:52 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2014-03-27 22:42:52 (GMT)
commit2542b66bb04e5634410205f54523987dce9e5bf7 (patch)
treef7c8072b257c67a1ed087f735cd9c7f6541f829e /Lib/test
parentb1d060bf8b017d2a6cf6a0191b1451aeb27a5c03 (diff)
downloadcpython-2542b66bb04e5634410205f54523987dce9e5bf7.zip
cpython-2542b66bb04e5634410205f54523987dce9e5bf7.tar.gz
cpython-2542b66bb04e5634410205f54523987dce9e5bf7.tar.bz2
inspect: Fix getcallargs() to fail correctly if more than 3 args are missing.
Patch by Jeremiah Lowin. Closes #20817.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_inspect.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 20f7217..38367f3 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -1214,6 +1214,12 @@ class TestGetcallargsFunctions(unittest.TestCase):
inspect.getcallargs(f5)
+ # issue20817:
+ def f6(a, b, c):
+ pass
+ with self.assertRaisesRegex(TypeError, "'a', 'b' and 'c'"):
+ inspect.getcallargs(f6)
+
class TestGetcallargsMethods(TestGetcallargsFunctions):
def setUp(self):