Skip to content

doctest: honor SKIP flags in testcode blocks - #14712

Open
Shashankrawat1504 wants to merge 1 commit into
sphinx-doc:masterfrom
Shashankrawat1504:fix/13103-doctest-skip
Open

Shashankrawat1504 wants to merge 1 commit into
sphinx-doc:masterfrom
Shashankrawat1504:fix/13103-doctest-skip

Conversation

@Shashankrawat1504

Copy link
Copy Markdown

Description

Fixes an issue where # doctest: +SKIP directives in testcode blocks were ignored.

Previously, inline doctest flags in testcode source were not interpreted when the code was executed together with a paired testoutput block. As a result, statements marked with +SKIP were still executed.

This change:

  • honors statement-level doctest flags in testcode blocks;
  • preserves the existing paired testcode/testoutput execution model;
  • keeps regular doctest block behavior unchanged;
  • preserves the existing trim_doctest_flags behavior;
  • adds regression tests for +SKIP and other doctest flags;
  • documents the supported behavior.

Testing

Relevant doctest and transform test suites pass, along with Ruff, Sphinx lint, formatting checks, and git diff --check.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant