Skip to content

Commit 0184fe6

Browse files
committed
Address review from @gforcada on the testing API reference
- 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.
1 parent 9e3592c commit 0184fe6

7 files changed

Lines changed: 15 additions & 9 deletions

File tree

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
extensions = [
4646
"myst_parser",
4747
"notfound.extension",
48-
"autodoc2", # developer-guide/testing plone.app.testing reference (static, no import)
48+
"autodoc2", # static API docs from source, no package import needed
4949
"sphinx.ext.autodoc",
5050
"sphinx.ext.autosummary", # plone.api
5151
"sphinx.ext.doctest", # plone.api
@@ -302,10 +302,10 @@
302302
# Don't show class signature with the class' name.
303303
autodoc_class_signature = "separated"
304304

305-
# -- Options for autodoc2 (plone.app.testing reference) -----------------------
305+
# -- Options for autodoc2 -----------------------------------------------------
306306
# autodoc2 analyses the source statically, so no package import and no Plone
307-
# installation are needed. It reads the plone.app.testing submodule directly.
308-
# The ``module`` key gives the namespace package its full dotted name.
307+
# installation are needed. It reads the package submodules directly.
308+
# The ``module`` key gives each namespace package its full dotted name.
309309
autodoc2_packages = [
310310
{
311311
"path": "../submodules/plone.app.testing/src/plone/app/testing",

docs/developer-guide/testing/drive-the-test-browser.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ This guide shows you how to write an end-to-end functional test that drives Plon
1515

1616
```{important}
1717
`zope.testbrowser` runs entirely in Python and does **not** run JavaScript.
18-
Use it for server-rendered pages (Classic UI). To test a Volto frontend, use the Volto documentation's end-to-end testing tools instead.
18+
Use it for server-rendered pages (Blicca, the frontend formerly called Classic UI).
19+
To test a Volto frontend, see [Test add-ons](/volto/development/add-ons/test-add-ons-19) instead.
1920
```
2021

2122
You need a **functional** layer, either `PLONE_FUNCTIONAL_TESTING` or your own layer built with `FunctionalTesting`.

docs/developer-guide/testing/how-testing-layers-work.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ This is how a functional layer can, for example, replace the database with a san
5050

5151
## Layers compose through bases
5252

53-
A layer declares its bases—the layers it builds on—through `defaultBases` or the `bases` argument.
54-
The test runner sets up each base once, in order, before the layer itself, and reuses an already-set-up base rather than building it again.
53+
A layer declares its bases—the layers it builds on.
54+
When you write a reusable layer class, you set them as the `defaultBases` class attribute.
55+
When you instantiate a layer directly to combine existing ones, you pass them as the `bases` argument instead; that is the exception, not the rule.
56+
Either way, the test runner sets up each base once, in order, before the layer itself, and reuses an already-set-up base rather than building it again.
5557

5658
The result is a tree of layers, each built once.
5759
A typical add-on's stack looks like this:

docs/developer-guide/testing/install-add-ons-in-tests.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ This guide shows you how to install a GenericSetup profile or an add-on inside a
1616
It uses the helpers from {doc}`testing-api-reference`.
1717
The examples assume a layer whose fixture already loaded your add-on's ZCML—see {doc}`write-a-testing-layer`.
1818

19+
```{tip}
1920
If you use pytest, {doc}`pytest-plone </developer-guide/testing/pytest>` also offers an `installer` fixture and an `@pytest.mark.portal(profiles=[...])` marker that do the same thing with less boilerplate.
21+
```
2022

2123
## Apply a profile
2224

docs/developer-guide/testing/testing-api-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Technical reference for Plone's testing API, drawn from two packages:
1717
- [plone.testing](https://github.com/plone/plone.testing): the underlying layer model and the Zope-level tools.
1818

1919
You import from whichever package a symbol lives in, but from a test author's point of view they are one toolkit, so this page is organized by task rather than by package.
20-
Each symbol is documented at its canonical location; re-exports are noted.
20+
Each symbol is documented at its canonical location; where one package re-exports a symbol from the other, that is noted.
2121

2222
To use these to write a `testing.py`, see {doc}`write-a-testing-layer`.
2323
For the model behind them, see {doc}`how-testing-layers-work`.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ linkify-it-py
22
plone-sphinx-theme<2
33
sphinx<9 # See https://github.com/plone/documentation/issues/2037
44
sphinx-autobuild
5+
sphinx-autodoc2
56
sphinx-copybutton
67
sphinx-design # Documentation only
78
sphinx-examples
@@ -17,4 +18,3 @@ sphinxcontrib-youtube
1718
sphinxext-opengraph
1819
sphinxcontrib.mermaid
1920
vale
20-
sphinx-autodoc2 # developer-guide/testing plone.app.testing reference

styles/config/vocabularies/Plone/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ APIs
99
backport(ed|ing)
1010
Barceloneta
1111
[Bb]oolean
12+
Blicca
1213
bugfix
1314
[Bb]uildout
1415
cacheable

0 commit comments

Comments
 (0)