Skip to content

Commit

Permalink
gh-122087: Add tests for ismethoddescriptor() and isroutine() with pa…
Browse files Browse the repository at this point in the history
…rtial objects (GH-122219)
  • Loading branch information
serhiy-storchaka committed Jul 25, 2024
1 parent a3327db commit bb10858
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/test/test_inspect/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit bb10858

Please sign in to comment.