0003. The engine carries its own unit suite, in the engine repository

Status

Accepted.

Context

The test-module and twister extensions is roughly 1170 lines of pure Python code — a Doxygen XML parser, a twister result reader, two reStructuredText builders and a directive module. Unlike the CMake surface, none of it needs a documentation build to exercise: it transforms XML and JSON into rST and needs objects.

Putting those tests in the acceptance repository would have been wrong. They would have run in minutes rather than in under a second, for code whose failures are not interaction failures.

Decision

The engine carries a second, fast unit suite in its own repository, at sphinx/_extensions/_tests/, covering the pure-Python extension modules.

Update 2026-10-09: the plain modules that the extensions share moved to sphinx/_scripts/, with their tests in sphinx/_scripts/_tests/. The fixtures of both moved to sphinx/_fixtures/. pytest.ini at the repository root selects both folders.

There are therefore two suites in two repositories:

$ cd tools/zdocs && python3 -m pytest -q                             # fast
$ cd zdocs-tests && python3 -m pytest tests/ -q                      # acceptance

Neither layer can contaminate the other’s count, and the engine becomes independently testable without a consumer.