pdoc icon indicating copy to clipboard operation
pdoc copied to clipboard

one of the pytest doctests in a docstring not rendered correctly

Open tmeyier opened this issue 3 years ago • 2 comments

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: 20220810_155256

Or apply

pdoc doctest_google.py --docformat google

and get this: 20220810_160505

System Information

pdoc: 12.0.2 Python: 3.9.13

tmeyier avatar Aug 10 '22 14:08 tmeyier

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. :)

mhils avatar Aug 11 '22 14:08 mhils

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: @.***>

tmeyier avatar Aug 11 '22 17:08 tmeyier