bpo-36994: add test for profiling method_descriptor with **kwargs (GH-13461)

It adds a missing testcase for bpo-34125. This is testing code which is
affected by PEP 590, so missing this test might accidentally break
CPython if we screw up with implementing PEP 590.
This commit is contained in:
Jeroen Demeyer 2019-05-22 12:05:02 +02:00 committed by Robert Collins
parent ef9d9b6312
commit b892d3ea46
1 changed files with 9 additions and 0 deletions

View File

@ -334,6 +334,15 @@ class ProfileSimulatorTestCase(TestCaseBase):
(1, 'return', j_ident), (1, 'return', j_ident),
]) ])
# bpo-34125: profiling method_descriptor with **kwargs
def test_unbound_method(self):
kwargs = {}
def f(p):
dict.get({}, 42, **kwargs)
f_ident = ident(f)
self.check_events(f, [(1, 'call', f_ident),
(1, 'return', f_ident)])
# Test an invalid call (bpo-34126) # Test an invalid call (bpo-34126)
def test_unbound_method_no_args(self): def test_unbound_method_no_args(self):
def f(p): def f(p):