Skip to content

Testing

Test Structure

tests/
├── conftest.py               # Shared fixtures
├── commands/                 # Tests for each command
├── step_actions/             # Tests for each step action
└── utils/                    # Test helpers (ANSI stripping, template fixtures)

Running Tests

poetry run pytest

With coverage report:

poetry run pytest --cov=portion --cov-report=term-missing

Type Checking

poetry run mypy portion/

Linting

poetry run flake8 portion/

Import Sorting

poetry run isort portion/

All of the above also run automatically via pre-commit hooks on every commit.