mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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
This commit is contained in:
parent
b3b8cb419e
commit
e89de73987
3 changed files with 46 additions and 3 deletions
|
@ -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"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue