8000 gh-122087: Add tests for ismethoddescriptor() and isroutine() with pa… · python/cpython@bb10858 · GitHub
[go: up one dir, main page]

Skip to content

Commit bb10858

Browse files
gh-122087: Add tests for ismethoddescriptor() and isroutine() with partial objects (GH-122219)
1 parent a3327db commit bb10858

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_inspect/test_inspect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ def test_isroutine(self):
402402
self.assertFalse(inspect.isroutine(type))
403403
self.assertFalse(inspect.isroutine(int))
404404
self.assertFalse(inspect.isroutine(type('some_class', (), {})))
405+
# partial
406+
self.assertTrue(inspect.isroutine(functools.partial(mod.spam)))
405407

406408
def test_isclass(self):
407409
self.istest(inspect.isclass, 'mod.StupidGit')
@@ -1693,6 +1695,7 @@ def function():
16931695
self.assertFalse(inspect.ismethoddescriptor(Owner.static_method))
16941696
self.assertFalse(inspect.ismethoddescriptor(function))
16951697
self.assertFalse(inspect.ismethoddescriptor(a_lambda))
1698+
self.assertTrue(inspect.ismethoddescriptor(functools.partial(function)))
16961699

16971700
def test_descriptor_being_a_class(self):
16981701
class MethodDescriptorMeta(type):

0 commit comments

Comments
 (0)
0