diff -r 3c3c9ad7c297 Lib/test/test_pydoc.py --- a/Lib/test/test_pydoc.py Sun Mar 17 15:49:21 2013 -0700 +++ b/Lib/test/test_pydoc.py Mon Mar 18 19:51:53 2013 -0700 @@ -258,7 +258,6 @@ title, _, _ = title.partition("") return title - class PydocDocTest(unittest.TestCase): @unittest.skipIf(sys.flags.optimize >= 2, @@ -395,6 +394,68 @@ synopsis = pydoc.synopsis(TESTFN, {}) self.assertEqual(synopsis, 'line 1: h\xe9') + def test_splitdoc_with_description(self): + example_string = "I Am A Doc\n\n\nHere is my description" + self.assertEqual(pydoc.splitdoc(example_string), + ('I Am A Doc', '\nHere is my description')) + + 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 a method")) + + def test_getting_all_methods_from_class(self): + class TestClass(object): + def method_returning_true(self): + """ + This will not appear in pydoc.allmethods + because it takes in a class instance + + And in the context of a class this is a function + + If allmethods was passed in an instance than this + in theory would be in the list. + However, pydoc.allmethods cannot take an instance. + """ + return True + + self.assertEqual(pydoc.allmethods(TestClass), + {'__format__': object.__format__, + '__str__': object.__str__, + '__repr__': object.__repr__, + '__le__': object.__le__, + '__reduce__': object.__reduce__, + '__init__': object.__init__, + '__subclasshook__': TestClass.__subclasshook__, + '__reduce_ex__': object.__reduce_ex__, + '__ge__': object.__ge__, + '__delattr__': object.__delattr__, + '__ne__': object.__ne__, + '__gt__': object.__gt__, + '__getattribute__': object.__getattribute__, + '__sizeof__': object.__sizeof__, + '__hash__': object.__hash__, + '__lt__': object.__lt__, + '__setattr__': object.__setattr__, + '__eq__': object.__eq__, + '__dir__': object.__dir__}) + + def test_is_package_when_not_package(self): + with test.support.temp_cwd() as test_dir: + self.assertFalse(pydoc.ispackage(test_dir)) + + def test_is_package_when_is_package(self): + with test.support.temp_cwd() as test_dir: + init_path = os.path.join(test_dir, '__init__.py') + open(init_path, 'w').close() + self.assertTrue(pydoc.ispackage(test_dir)) + os.remove(init_path) class PydocImportTest(unittest.TestCase): diff -r 3c3c9ad7c297 Misc/ACKS --- a/Misc/ACKS Sun Mar 17 15:49:21 2013 -0700 +++ b/Misc/ACKS Mon Mar 18 19:51:53 2013 -0700 @@ -1361,4 +1361,4 @@ Kai Zhu Tarek Ziadé Peter Åstrand - +Matt Bachmann