Skip to content

Document sphinx.testing#14205

Open
pradyunsg wants to merge 23 commits intosphinx-doc:masterfrom
pradyunsg:feature-testing-docs
Open

Document sphinx.testing#14205
pradyunsg wants to merge 23 commits intosphinx-doc:masterfrom
pradyunsg:feature-testing-docs

Conversation

@pradyunsg
Copy link
Contributor

@pradyunsg pradyunsg commented Dec 21, 2025

Purpose

Add more details to the documentation page of sphinx.testing.

Some things are somewhat intentionally not documented right now, to keep the first iteration of this somewhat tractable for a 3am job. 😅

  • sphinx.testing.fixtures.test_params -- this was a bit tricky to describe, so I decided to defer it.
  • sphinx.testing.fixtures.shared_result -- this was a bit tricky to describe, so I decided to defer it.
  • sphinx.testing.fixtures._shared_result_cache -- private name.
  • sphinx.testing.restructuredtext.parse -- I got tired. 🙃
  • sphinx.testing.util.assert_node -- not exported in __all__.

References


PS: I did use GitHub Copilot as a part of my process for writing these docs. I did rewrite basically everything but some mistakes might have happened downstream of that usage. 😅

@pradyunsg
Copy link
Contributor Author

I didn't touch any Python code here -- the ty failure seems to be unrelated to this PR.

The following are not documented in this commit:

- `sphinx.testing.fixtures.test_params`
- `sphinx.testing.fixtures.shared_result`
- `sphinx.testing.fixtures._shared_result_cache`
- `sphinx.testing.restructuredtext.parse`
- `sphinx.testing.util.assert_node`
@jdillard
Copy link
Member

Comment on lines -4 to -6
.. py:module:: sphinx.testing
:synopsis: Utility functions and pytest fixtures for testing.

Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's the question here?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, just why has this been deleted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No particular reason

AA-Turner and others added 22 commits December 30, 2025 23:07
Co-authored-by: Jared Dillard <jared.dillard+github@gmail.com>
…hinx-doc#14024)

Co-authored-by: Jean-François B. <2589111+jfbu@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Formerly, PDF rendering crashed for inputs of more than about 1350
codelines either from a code-block, or from a literal include, when this
literal include used the sphinxVerbatim and not the sphinxalltt route.

The fix goes via novel mark-up which is applied in case the literally
included file or code-block contains more than 500 codelines. Then
chunks of 500 consecutive source codelines are rendered using:

sphinxLongVerbatimFirst, sphinxLongVerbatimMiddle, and
sphinxLongVerbatimLast.

Efforts have been devoted for line numbering and emphasizing to not be
modified, and (if so configured) for bottom captions to appear where
expected.

It was needed to (to cut into smaller pieces and) modify in a very
limited manner the legacy sphinxVerbatim which is still used for up to
500 codelines, which corresponds to about 10 a4-sized pages, if document
is with default pointsize and margins.

Hopefully no consequences will arise from these changes.

Known issue: in the unlikely event a pagebreak happens exactly after a
chunk of 500 code lines, the continuation hints usually printed at
bottom and top of pages are omitted.
…tly to PDF if using ``literalinclude`` (sphinx-doc#14066)

They can not attow come from code-blocks, having been replaced during
Docutils/Sphinx processing with spaces before ending in the .tex file.
But they may originate from literalinclude directive.

Known limitation: only "top-level" TABs will obey tab stops.  Indeed,
TABs ending inside the Pygmentize highlighting macro \PYG would cause
breakage if the fancyvrb.sty method for them to obey tab stops was put
at work.  So Sphinx modifies \PYG to let TABs in such location get
converted to a fixed number (default 8) of spaces.

Close sphinx-doc#14064
@pradyunsg
Copy link
Contributor Author

@AA-Turner it looks like your rebase/merge went wrong here?

@AA-Turner
Copy link
Member

Yes, sorry, not quite sure what happened.

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.testing is undocumented

8 participants