benf-wspdigital · GitHub

@brianmay

@brianmay brianmay changed the title Wip/issue/issue30181 parse docstring using pydoc bpo-30181 parse docstring using pydoc

May 9, 2017

@brianmay brianmay changed the title bpo-30181 parse docstring using pydoc bpo-30181: parse docstring using pydoc

May 9, 2017

serhiy-storchaka

"""
Return the test case short description from a docstring.

Ths docstring is parsed by the standard `pydoc.splitdoc` function
@unittest.skipIf(
sys.flags.optimize >= 2,
"Docstrings are omitted with -O2 and above")
def testShortDescriptionWithSurroundingSpaceOneLineDocstring(self):

serhiy-storchaka

"""
Return the test case short description from a docstring.

Ths docstring is parsed by the standard `pydoc.splitdoc` function
doc = self._testMethodDoc
return doc and doc.split("\n")[0].strip() or None

""" Return a one-line description of the test, if any; otherwise None. """
@unittest.skipIf(
sys.flags.optimize >= 2,
"Docstrings are omitted with -O2 and above")
def testShortDescriptionWithSurroundingSpaceOneLineDocstring(self):

Closed

cjerdonek

.format(logging.getLevelName(self.level), self.logger.name))


def short_description_from_docstring(text):

cjerdonek

Read the original on github.com ↗