one of the pytest doctests in a docstring not rendered correctly
Problem Description
One of the doctests in the example below isn´t rendered correctly. The behavior depends on indentation and on the --docformat command argument: see example below.
Steps to reproduce the behavior:
test script doctest_google.py:
def bla():
"""Print bla.
Examples:
>>> bla()
blu
>>> bla()
bla
"""
print("bla")
def bli():
"""Print bli.
Examples:
>>> bli()
bli
>>> bli()
blo
"""
print("bli")
bla()
bli()
Apply:
pdoc doctest_google.py
or
pdoc doctest_google.py --docformat restructuredtext
And get this:

Or apply
pdoc doctest_google.py --docformat google
and get this:

System Information
pdoc: 12.0.2 Python: 3.9.13
pdoc doctest_google.py --docformat google should be fixed in https://github.com/trentm/python-markdown2/pull/462/commits/f1634cc0b1e1de6015050860e684eccea06f0f5c. I'll revisit the other case once the changes upstream have landed. :)
Thanks for your super quick response - and for your dedication to free software. :-) Am 11.08.2022 16:10 schrieb Maximilian Hils @.>: pdoc doctest_google.py --docformat google should be fixed in @. I'll revisit the other case once the changes upstream have landed. :)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>