def test_is_object_or_method(self): doc = pydoc.Doc() # Bound Method self.assertTrue(pydoc._is_some_method(doc.fail)) # Method Descriptor self.assertTrue(pydoc._is_some_method(int.__add__)) # String self.assertFalse(pydoc._is_some_method("I am not a method"))
def test_is_object_or_method(self): doc = pydoc.Doc() self.assertTrue(pydoc._is_some_method(doc.fail)) self.assertTrue(pydoc._is_some_method(int.__add__)) self.assertFalse(pydoc._is_some_method('I am not a method'))