mirror of https://github.com/python/cpython
gh-122087: Add tests for ismethoddescriptor() and isroutine() with partial objects (GH-122219)
This commit is contained in:
parent
a3327dbfd4
commit
bb108580de
|
@ -402,6 +402,8 @@ class TestPredicates(IsTestBase):
|
|||
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 @@ class TestIsMethodDescriptor(unittest.TestCase):
|
|||
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):
|
||||
|
|
Loading…
Reference in New Issue