summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys_setprofile.py
diff options
context:
space:
mode:
authorjdemeyer <jdemeyer@cage.ugent.be>2018-09-19 10:06:20 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-09-19 10:06:20 (GMT)
commite89de7398718f6e68848b6340830aeb90b7d582c (patch)
treeb8b0e00f2ab2ae1e7b4438b954f59273b31748af /Lib/test/test_sys_setprofile.py
parentb3b8cb419e496629873fa7dda82a01863f58617a (diff)
downloadcpython-e89de7398718f6e68848b6340830aeb90b7d582c.zip
cpython-e89de7398718f6e68848b6340830aeb90b7d582c.tar.gz
cpython-e89de7398718f6e68848b6340830aeb90b7d582c.tar.bz2
bpo-34125: Enable profiling of method_descriptor in all cases (GH-8416)
`list.append([], None)` was profiled but `list.append([], None, **{})` was not profiled. Enable profiling for later case. https://bugs.python.org/issue34125
Diffstat (limited to 'Lib/test/test_sys_setprofile.py')
-rw-r--r--Lib/test/test_sys_setprofile.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_sys_setprofile.py b/Lib/test/test_sys_setprofile.py
index 16467e7..c2ecf8e 100644
--- a/Lib/test/test_sys_setprofile.py
+++ b/Lib/test/test_sys_setprofile.py
@@ -350,6 +350,24 @@ class ProfileSimulatorTestCase(TestCaseBase):
self.check_events(f, [(1, 'call', f_ident),
(1, 'return', f_ident)])
+ # Test an invalid call (bpo-34125)
+ def test_unbound_method_no_args(self):
+ kwargs = {}
+ def f(p):
+ dict.get(**kwargs)
+ f_ident = ident(f)
+ self.check_events(f, [(1, 'call', f_ident),
+ (1, 'return', f_ident)])
+
+ # Test an invalid call (bpo-34125)
+ def test_unbound_method_invalid_args(self):
+ kwargs = {}
+ def f(p):
+ dict.get(print, 42, **kwargs)
+ f_ident = ident(f)
+ self.check_events(f, [(1, 'call', f_ident),
+ (1, 'return', f_ident)])
+
def ident(function):
if hasattr(function, "f_code"):