Handbook
Games testing guide
Pytest discovers tests/games automatically when run from forge-lcdl with pythonpath = src (see pyproject.toml).
Layers
| Scope | Paths | Purpose |
|---|---|---|
| Architecture | tests/games/test_architecture_imports.py, tests/games/test_no_engine_llm_imports.py |
AST guard: games/engine must not reference LCDL transport/tasks |
| Engine rules | tests/games/engine/test_games_*, test_engine_connect_four_like.py |
Correctness per reference GAME_ID |
| Mechanics | tests/games/engine/mechanics |
Topology helpers |
| Replay / RNG / logs | test_replay.py, test_rng.py, test_logs.py |
Determinism and hashes |
| CLI | tests/games/test_cli.py |
Subprocess smoke for python -m forge_lcdl.games.engine … |
| Adapters | tests/games/adapters/test_web_json.py |
JSON envelopes |
| LCDL tasks | tests/tasks/test_game_move_*.py |
Fake ChatFn + validation |
| Docs | tests/docs/test_game_docs_exist.py |
Required Markdown files present |
Fixtures
Replay goldens live under tests/games/fixtures/replay/ (e.g. tic_tac_toe_three_moves.json) with fixture_kind: game_log_v1 or moves_replay_v1.
Commands
python3 -m pytest tests/games -q
python3 -m pytest tests/tasks/test_game_move_*.py -q
python3 -m pytest tests/ --ignore=tests/integration -q
Integration tests under tests/integration require Granite/network markers.