Esempio n. 1
0
def test_parse_docstring():
    from pep257 import parse_docstring as pd

    d1 = '''def foo():  # o hai comment
    """docstring"""
    2 + 2'''
    assert pd(d1) == '"""docstring"""'

    d2 = '''def foo():  # o hai comment
    2 + 2'''
    assert pd(d2) == None

    assert pd("def foo():pass") == None
Esempio n. 2
0
def test_parse_docstring():
    from pep257 import parse_docstring as pd

    s1 = '''def foo():  # o hai comment
    """docstring"""
    2 + 2'''
    assert pd(s1) == '"""docstring"""'

    s2 = '''def foo():  # o hai comment
    2 + 2'''
    assert pd(s2) is None

    assert pd("def foo():pass") is None
Esempio n. 3
0
def test_parse_docstring():
    from pep257 import parse_docstring as pd

    d1 = '''def foo():  # o hai comment
    """docstring"""
    2 + 2'''
    assert pd(d1) == '"""docstring"""'

    d2 = '''def foo():  # o hai comment
    2 + 2'''
    assert pd(d2) == None

    assert pd("def foo():pass") == None