| 1 |
# Test docstring extraction |
| 2 |
from gettext import gettext as _ |
| 3 |
|
| 4 |
|
| 5 |
# Empty docstring |
| 6 |
def test(x): |
| 7 |
"""""" |
| 8 |
|
| 9 |
|
| 10 |
# Leading empty line |
| 11 |
def test2(x): |
| 12 |
|
| 13 |
"""docstring""" # XXX This should be extracted but isn't. |
| 14 |
|
| 15 |
|
| 16 |
# XXX Multiline docstrings should be cleaned with `inspect.cleandoc`. |
| 17 |
def test3(x): |
| 18 |
"""multiline |
| 19 |
docstring |
| 20 |
""" |
| 21 |
|
| 22 |
|
| 23 |
# Multiple docstrings - only the first should be extracted |
| 24 |
def test4(x): |
| 25 |
"""docstring1""" |
| 26 |
"""docstring2""" |
| 27 |
|
| 28 |
|
| 29 |
def test5(x): |
| 30 |
"""Hello, {}!""".format("world!") # XXX This should not be extracted. |
| 31 |
|
| 32 |
|
| 33 |
# Nested docstrings |
| 34 |
def test6(x): |
| 35 |
def inner(y): |
| 36 |
"""nested docstring""" # XXX This should be extracted but isn't. |
| 37 |
|
| 38 |
|
| 39 |
class Outer: |
| 40 |
class Inner: |
| 41 |
"nested class docstring" # XXX This should be extracted but isn't. |