def test_parse_docstring_without_title(): """ If a docstring contains multiple lines but the first one doesn't start with a #, the whole docstring is considered the description. """ assert parse_docstring('not the title\nnot the title') == (None, 'not the title\nnot the title') assert parse_docstring('not the title') == (None, 'not the title')
def test_parse_docstring_with_title_only(): assert parse_docstring('# title') == ('title', None) assert parse_docstring('# title\n\n') == ('title', None)
def test_parse_docstring_with_title_and_description(): assert parse_docstring('# title\n\ndescription') == ('title', 'description')
def test_parse_docstring_without_docstring(): assert parse_docstring('') == (None, None) assert parse_docstring(' ') == (None, None) assert parse_docstring(None) == (None, None)