https://github.com/python/cpython/commit/bb108580dec5d8655ccdfb6c8737b5f64e3366d0
commit: bb108580dec5d8655ccdfb6c8737b5f64e3366d0
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-07-25T10:12:26+03:00
summary:
gh-122087: Add tests for ismethoddescriptor() and isroutine() with partial
objects (GH-122219)
files:
M Lib/test/test_inspect/test_inspect.py
diff --git a/Lib/test/test_inspect/test_inspect.py
b/Lib/test/test_inspect/test_inspect.py
index 5521528a524762..730c192d1aa260 100644
--- a/Lib/test/test_inspect/test_inspect.py
+++ b/Lib/test/test_inspect/test_inspect.py
@@ -402,6 +402,8 @@ def test_isroutine(self):
self.assertFalse(inspect.isroutine(type))
self.assertFalse(inspect.isroutine(int))
self.assertFalse(inspect.isroutine(type('some_class', (), {})))
+ # partial
+ self.assertTrue(inspect.isroutine(functools.partial(mod.spam)))
def test_isclass(self):
self.istest(inspect.isclass, 'mod.StupidGit')
@@ -1693,6 +1695,7 @@ def function():
self.assertFalse(inspect.ismethoddescriptor(Owner.static_method))
self.assertFalse(inspect.ismethoddescriptor(function))
self.assertFalse(inspect.ismethoddescriptor(a_lambda))
+
self.assertTrue(inspect.ismethoddescriptor(functools.partial(function)))
def test_descriptor_being_a_class(self):
class MethodDescriptorMeta(type):
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]