Add a Testing API reference (plone.app.testing + plone.testing) - #2097
Open
jensens wants to merge 5 commits into
Open
Add a Testing API reference (plone.app.testing + plone.testing)#2097jensens wants to merge 5 commits into
jensens wants to merge 5 commits into
Conversation
Extends the developer-guide/testing chapter with an autodoc-generated API reference and a deeper layer-model explanation, covering both testing packages as one toolkit (a test author does not care which package a symbol lives in). - testing-api-reference.md: organized by task (layer model, pre-built layers and fixtures, browser and HTTP, helpers, sandboxing primitives, constants), pulling symbols from both packages at their canonical location, with re-exports noted. Generated by sphinx-autodoc2, which reads the sources statically -- so no Plone is installed in the docs build. Both packages are added as source-only submodules. - how-testing-layers-work.md: deepened with the fixture/lifecycle split. - install-add-ons-in-tests.md, drive-the-test-browser.md: two how-tos that absorb the test-specific patterns from plone.app.testing's README. conf.py gains the autodoc2 extension beside the existing sphinx.ext.autodoc (used by plone.api); the two coexist. Legacy ZServer is noted, not documented. Vale is clean on the new pages.
gforcada
reviewed
Jul 28, 2026
gforcada
left a comment
Member
There was a problem hiding this comment.
Very nice! 🌟 I have only a few suggestions for improvements rather than blockers 👍🏾
- Sort sphinx-autodoc2 into requirements.txt. - Make the autodoc2 conf.py comments generic instead of naming a specific consumer, which would outdate. - Name the two packages explicitly in the chapter index instead of 'both packages'. - Clarify defaultBases vs the bases argument (class default vs the instantiation-time exception) rather than listing them as equivalent. - Highlight the pytest alternative in the install how-to as a tip. - Name Blicca (formerly Classic UI) and link the Volto testing docs in the test-browser how-to. Kept the reference intro as prose rather than a third admonition, per the Plone docs guidance to use admonitions sparingly.
Member
Author
|
Thanks @gforcada! Addressed in the last commit:
Two where I did something a bit different, curious what you think:
|
The previous review fix silently no-op'd (the search text omitted a word), so the line still read 'from both packages'. Name plone.app.testing and plone.testing explicitly, as intended.
gforcada
approved these changes
Jul 30, 2026
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.
Builds on #2094 (the backend testing chapter). Targets
backend-testing-docs; merge #2094 first. GitHub will retarget this to6.0once #2094 lands.What
Adds an autodoc-generated API reference and a deeper layer-model explanation to the
developer-guide/testingchapter, plus two how-tos. It covers both testing packages as one toolkit, because a test author does not care whether a symbol lives inplone.app.testingorplone.testing.testing-api-reference.mdpushGlobalRegistryunderplone.testing.zca, with a re-export note), from both packages.how-testing-layers-work.mdinstall-add-ons-in-tests.md,drive-the-test-browser.mdplone.app.testing's README.How the reference is built
sphinx-autodoc2, which analyses the sources statically. So:sphinx.ext.autodocwould need to importplone.app.testing, which pulls in ~226 packages (all of Plone). autodoc2 needs neither. Both packages are added as source-only submodules.sphinx.ext.autodoc(used byplone.api).plone.testingsubmodule pins master; theLayerclass docstring there is currently a one-liner. Expand the Layer base class docstring plone.testing#134 enriches it, after which a submodule bump renders it in full. The reference is complete either way; that entry just gets richer.Notes
Browseris a re-export from a private module (plone.testing._z2_testbrowser), which autodoc2 cannot resolve, so it is documented as a short prose entry.PLONE_ZSERVER,PLONE_FTP_SERVER) is noted, not documented — Plone 6 runs on WSGI.🤖 Generated with Claude Code