Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one of the pytest doctests in a docstring not rendered correctly #429

Closed
tmeyier opened this issue Aug 10, 2022 · 2 comments
Closed

one of the pytest doctests in a docstring not rendered correctly #429

tmeyier opened this issue Aug 10, 2022 · 2 comments

Comments

@tmeyier
Copy link
Contributor

tmeyier commented Aug 10, 2022

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 tmeyier added the bug label Aug 10, 2022
mhils added a commit to mhils/python-markdown2 that referenced this issue Aug 11, 2022
mhils added a commit to mhils/python-markdown2 that referenced this issue Aug 11, 2022
@mhils
Copy link
Member

mhils commented Aug 11, 2022

pdoc doctest_google.py --docformat google should be fixed in trentm/python-markdown2@f1634cc. I'll revisit the other case once the changes upstream have landed. :)

@mhils mhils added the upstream label Aug 11, 2022
@tmeyier
Copy link
Contributor Author

tmeyier commented Aug 11, 2022 via email

@mhils mhils closed this as completed in 3337978 Aug 23, 2022
clrpackages pushed a commit to clearlinux-pkgs/pypi-markdown2 that referenced this issue Sep 27, 2022
…rsion 2.4.5

Bastian Venthur (9):
      Removed Python2 support.
      removed unused imports
      extend github ci to include tests for windows and mac as well
      create proper entry point.
      removed pypy3
      removed weird double parenthesis with prints
      removed lists around keys() etc
      unfixed an intentional list occurence
      fixed ticks

Crozzers (31):
      Fix filter bypass leading to XSS (#362)
      Fix `TypeError` if `html-classes` extra is None #391
      Replace `<strike>` with `<s>` in strike extra #444
      Stop link patterns extra matching within auto links (issue #385)
      Stop link patterns extra matching within markdown links (issue #385)
      Fix link patterns being skipped if there's an auto link in the same line
      Fix formatting in CHANGES.md
      Fix backticks not working inside link text (issue #344)
      Add tests for Python 3.10
      Ignore encoded code spans in `_hash_html_spans`
      Fix `AttributeError` when using some extras via an emacs style local variable.
      Automatically wrap emacs local variable one-liners in HTML comment tags
      Add test case for auto-wrapping emacs one-liners
      Fix emacs one-liner file vars having surrounding whitespace stripped
      Add test case for #460
      Fix incorrect test case for `break-on-newline` extra
      Fix incorrect result for multi-level lists (issue #275)
      Update admonitions test case to make tests pass
      Fix `html-classes` extra not applying to code spans
      Add optional dependencies to `setup.py`
      Use `setup.py` extra requirements to install optional dependencies for tests
      Update `CHANGES.md`
      Re-write `_uniform_outdent` function and remove `_uniform_outdent_limit`.
      Update CHANGES.md
      Add support for ordered lists that don't start at 1. (issue #469)
      Update `CHANGES.md`
      Fix `AssertionError` with lazy numbered lists (issue #471)
      Update `CHANGES.md`
      Add missing opts file for test case
      Add `<ul>` and `<ol>` tags to `html-classes` extra (#352)
      Fix sanitization for nested incomplete tags (see #473)

Max Omdal (4):
      fix fenced code block escaping list #276
      cleanup outdenting on fenced codeblocks and refactor code block with highlighting into it's own method
      Add tests
      update indent/outdent to handle code blocks formatted with pygment

Maximilian Hils (3):
      add test case for pygments + div
      make sure that pygments blocks are picked up by HTML block detection
      fix pyshell blocks in blockquotes, refs mitmproxy/pdoc#429

Nicholas Serra (20):
      prep for future dev
      Update CHANGES.md
      Update CHANGES.md
      Update CHANGES.md
      Update CHANGES.md
      Update CHANGES.md
      Update CHANGES.md
      Changes and contribs
      Update CHANGES.md
      Update CHANGES.md
      Changes and contributors
      Changes and contributors
      Update CHANGES.md
      Update CHANGES.md
      Update CHANGES.md
      Update CHANGES.md
      Update CHANGES.md
      prepare for 2.4.4 release
      prep for future dev
      prepare for 2.4.5 release

bob (2):
      Underline and HTML comments
      Links

vin01 (1):
      Add test for nested incomplete tag sanitization

Łukasz Langa (1):
      Add an example of the current mixed-paragraph mode behavior in lists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants