Skip to content

Commit dd1904e

Browse files
committed
docs(AGENTS): add functional-only test style guideline
Document that class-based tests are forbidden and only functional pytest tests should be used.
1 parent cec80fd commit dd1904e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,18 @@ These fixtures handle setup and teardown automatically, creating isolated test e
181181

182182
### Testing Guidelines
183183

184-
1. **Use existing fixtures over mocks**
184+
1. **Use functional tests only**: Write tests as standalone functions, not classes. Avoid `class TestFoo:` groupings - use descriptive function names and file organization instead.
185+
186+
2. **Use existing fixtures over mocks**
185187
- Use fixtures from conftest.py instead of `monkeypatch` and `MagicMock` when available
186188
- For libtmux, use provided fixtures: `server`, `session`, `window`, and `pane`
187189
- Document in test docstrings why standard fixtures weren't used for exceptional cases
188190

189-
2. **Preferred pytest patterns**
191+
3. **Preferred pytest patterns**
190192
- Use `tmp_path` (pathlib.Path) fixture over Python's `tempfile`
191193
- Use `monkeypatch` fixture over `unittest.mock`
192194

193-
3. **Running tests continuously**
195+
4. **Running tests continuously**
194196
- Use pytest-watcher during development: `uv run ptw .`
195197
- For doctests: `uv run ptw . --now --doctest-modules`
196198

0 commit comments

Comments
 (0)