Repository navigation
Stabilize test_html5_rubric - #14792
Open
thisisshivamtiwari wants to merge 1 commit into
Open
thisisshivamtiwari wants to merge 1 commit into
thisisshivamtiwari wants to merge 1 commit into
Conversation
The test asserts on a warning that docutils emits while reading index.rst. The latex, man and texinfo rubric tests use the same markup-rubric test root, so when one of them runs first in the same worker, the HTML build reuses the pickled environment, never re-reads the source, and the warning is missing. Use a fresh environment. Fixes sphinx-doc#14791
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14791
Purpose
test_html5_rubricchecks for two warnings. One of them,"7" unknown, is the docutils error for:heading-level: 7, and it is only emitted whileindex.rstis being read.The latex, man and texinfo rubric tests (
test_latex_rubric,test_rubric,test_texinfo_rubric) use the samemarkup-rubrictest root. They therefore share its source and doctree directories. If one of them runs beforetest_html5_rubricin the same worker, the HTML build loads the pickled environment, doesn't re-readindex.rst, and the directive warning never appears. Only the HTML writer'sunsupported rubric heading level: 7warning is left, which matches the failure in the linked CI run. So it depends on test order under xdist, not on the docutils development version.The fix adds
freshenv=Trueto the test'spytest.mark.sphinxmarker, so this test always reads its sources. The other three rubric tests only check the output, so they are unaffected.Testing
On
master(docutils 0.23, Python 3.14), this fails every time:With this change:
tests/test_builders/test_build_html_5_output.pypasses (173 tests);pytest -n auto tests/test_builderspasses (769 passed, 13 skipped), run twice;ruff checkandruff format --checkon the changed file pass.I didn't add a CHANGES entry because this only touches a test (see #14572 for the same kind of change). I'm happy to add one if you'd like.