Skip to content

Run doctest #177

Description

@m-aciek

CPython docs contain doctest codeblocks that can be tested to ensure correct translations.

it works with make doctest SPHINXOPTS='-D language=pt_BR'

Do keep in mind that doctests are just as version-sensitive as the full Python test suite; the Python used to run the doctests should ideally be built from the same commit as the doctests themselves

Suggested by @rffontenelle on Discord.

Activity

  1. m-aciek commented on Oct 4, 2026

    @m-aciek
    CollaboratorAuthor

    FWIW as of today there are 516 .. doctest:: directives, 440 blocks starting with >>> and 118 .. testcode:: directives.

    Though currently Sphinx don't extract doctest blocks due to a bug tracked at sphinx-doc/sphinx#12871. Running doctest will make sense only after a fix is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions