Skip to content

docs: execute context.clear() in doctests for Sphinx 9 compatibility#2717

Open
bobo-xxx wants to merge 1 commit intoGallopsled:devfrom
bobo-xxx:clawoss/fix/sphinx9-context-clear
Open

docs: execute context.clear() in doctests for Sphinx 9 compatibility#2717
bobo-xxx wants to merge 1 commit intoGallopsled:devfrom
bobo-xxx:clawoss/fix/sphinx9-context-clear

Conversation

@bobo-xxx
Copy link
Copy Markdown

Summary

In Sphinx 9, doctest blocks marked with :hide: are not executed. This causes context.clear() calls in hidden blocks to be skipped, leading to assembler tests using the wrong architecture (arm instead of i386).

Fix

This change moves context.clear() out of hidden doctest blocks into visible doctest lines, ensuring they are executed properly in Sphinx 9+.

Changes

  • docs/source/intro.rst: Replaced two hidden doctest blocks containing context.clear() with visible doctest lines.

Testing

The issue manifests when running doctests with Sphinx 9+, where hidden blocks are not executed. This fix ensures the context clearing happens as part of the visible doctest flow.

Fixes #2711

In Sphinx 9, doctest blocks marked with :hide: are not executed.
This causes context.clear() calls in hidden blocks to be skipped,
leading to assembler tests using the wrong architecture (arm
instead of i386).

This change moves context.clear() out of hidden doctest blocks
into visible doctest lines, ensuring they are executed properly
in Sphinx 9+.
Copilot AI review requested due to automatic review settings April 18, 2026 07:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the introductory documentation doctests to remain compatible with Sphinx 9’s behavior change where .. doctest:: blocks marked :hide: are no longer executed, which previously caused context.clear() to be skipped and subsequent assembler examples to run under the wrong architecture.

Changes:

  • Removed two hidden .. doctest:: :hide: blocks that contained context.clear().
  • Placed >>> context.clear() as regular visible doctest lines so they execute under Sphinx 9+ doctest runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Sphinx 9 incompatibility

2 participants