From 205521953d1d1fece1ffbdbc82355cde973bb9b3 Mon Sep 17 00:00:00 2001 From: dlq Date: Fri, 29 May 2026 14:04:32 -0400 Subject: [PATCH] Add pytest to dev tooling --- README.md | 12 ++++++++++++ setup.cfg | 1 + setup.py | 1 + 3 files changed, 14 insertions(+) diff --git a/README.md b/README.md index f181e19..8f7d51c 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,12 @@ pip install -e ".[dev]" This project is a pure Python CLI. There is no separate compile or build step for normal development; installing in editable mode is enough to run the local `cbrain` command. +The `dev` extra installs the local review tools used by this repository: + +- `ruff` for linting and formatting; +- `pytest` for focused unit tests; +- `pre-commit` for local hook checks. + ### Linting And Formatting Ruff is used for linting and formatting: @@ -205,6 +211,12 @@ The existing test suite is based on capture tests in `capture_tests/`. These are Capture tests require a local CBRAIN test server on `localhost:3000` with the expected test database seed. The GitHub Actions workflow sets this up by checking out the CBRAIN server repository at https://github.com/aces/cbrain. +Focused unit tests should use `pytest` and should not require a live CBRAIN server: + +```bash +pytest +``` + When command output intentionally changes, update `capture_tests/expected_captures.txt`. When behavior changes without intended output changes, prefer adding focused unit tests where possible. ### Continuous Integration diff --git a/setup.cfg b/setup.cfg index 78adb4a..b63c51f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,4 +27,5 @@ console_scripts = [options.extras_require] dev = pre-commit>=3.5.0 + pytest>=8.0.0 ruff>=0.8.5 diff --git a/setup.py b/setup.py index 8a9f028..d31fd5c 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,7 @@ extras_require={ "dev": [ "pre-commit>=3.5.0", + "pytest>=8.0.0", "ruff>=0.8.5", ], },