summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys_setprofile.py
diff options
context:
space:
mode:
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"):