Skip to content

Testing

The PettingZoo API contract is tested in the repository with Farama's api_test helper and focused wrapper tests.

Contract Tests

Run the focused tests:

uv run pytest tests/test_pettingzoo_wrapper.py tests/test_pettingzoo_deckbuilding.py

The tests cover:

  • PettingZoo AEC API compatibility.
  • Seeded reset stability.
  • Observation-space containment.
  • Action-mask dtype and shape.
  • Hidden hand visibility.
  • Pending-choice option encoding.
  • Status, counter, and row-effect encoding.
  • Sparse terminal rewards.
  • Deckbuilding stage flow and match transition.

Generated Docs Drift

Reference pages are generated from the live wrappers. Check them with:

uv run python tools/render_pettingzoo_docs.py --check

Regenerate them after changing action ids, observation schemas, catalog surface, or deckbuilding metadata:

uv run python tools/render_pettingzoo_docs.py

Site Build

Build the docs with strict warnings:

uv run zensical build --strict --clean

Preview locally:

uv run zensical serve

zensical serve currently advertises strict mode as unsupported, so strictness belongs on the build command.