Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:
run: uv run mypy smoothify/

- name: Test
run: uv run pytest tests/ -x -q
# -n 2 overrides the local `-n auto` default: GitHub runners have 4
# vCPUs and some tests spawn smoothify's own worker pool, so a smaller
# fan-out avoids oversubscribing the runner.
run: uv run pytest tests/ -n 2 -x -q

- name: Notebook smoke test
if: matrix.python-version == '3.11'
run: uv run pytest --nbmake examples/*.ipynb -q
run: uv run pytest --nbmake examples/*.ipynb -n 2 -q
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,17 @@ Smoothify uses [pytest](https://pytest.org/). After cloning the repository, inst
# Install dependencies (including the dev group)
uv sync

# Run all tests
# Run all tests (parallelised across CPU cores by default via pytest-xdist)
uv run pytest tests/

# Run with coverage
uv run pytest tests/ --cov=smoothify --cov-report=html

# Run a single test
uv run pytest tests/test_chaikin.py::TestChaikinCornerCutting::test_simple_square_polygon
# Run a single test (add `-n 0` to disable parallelism for clearer output)
uv run pytest tests/test_chaikin.py::TestChaikinCornerCutting::test_simple_square_polygon -n 0
```

If you prefer not to use uv, install the dev dependencies into your environment and run `pytest tests/` directly.
The suite runs in parallel by default (`-n auto` in `pytest.ini`); pass `-n 0` to run serially when debugging. If you prefer not to use uv, install the dev dependencies into your environment and run `pytest tests/` directly.

## Contributing

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dev = [
"pre-commit>=4.0",
"pytest>=8.4.2",
"pytest-cov>=6.0.0",
"pytest-xdist>=3.8.0",
"ruff>=0.12.2",
]

Expand Down Expand Up @@ -77,4 +78,4 @@ select = ["E", "F", "B"]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["E402"]
"*.ipynb" = ["E402", "E501"]
"*.ipynb" = ["E402", "E501"]
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ addopts =
--strict-markers
--tb=short
--color=yes
-n auto
--dist worksteal
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
integration: marks tests as integration tests
Expand Down