Skip to content

Commit adc5a38

Browse files
test: add mutation testing with mutmut
1 parent eab726c commit adc5a38

4 files changed

Lines changed: 306 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ wheels/
1717
.coverage
1818
.coverage.*
1919
htmlcov/
20+
mutants/
2021

2122
# Linting / type-checking caches
2223
.ruff_cache/

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.DEFAULT_GOAL := help
22

3-
.PHONY: help install install-dev install-demo sync lint format typecheck test test-integration coverage check fix pre-commit docs docs-serve clean
3+
.PHONY: help install install-dev install-demo sync lint format typecheck test test-integration coverage mutate check fix pre-commit docs docs-serve clean
44

55
help: ## Show this help message
66
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
@@ -36,6 +36,9 @@ test-integration: ## Run integration tests (requires Phoenix)
3636
coverage: ## Run pytest with coverage report
3737
uv run pytest tests/ -q --cov=evalwire --cov-report=term-missing --cov-fail-under=85
3838

39+
mutate: ## Run mutation testing with mutmut
40+
uv run mutmut run
41+
3942
check: lint format typecheck test ## Run all checks (lint, format, typecheck, test)
4043

4144
fix: ## Auto-fix lint and format issues

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,19 @@ markers = [
6969
]
7070
addopts = "-m 'not integration'"
7171

72+
[tool.mutmut]
73+
paths_to_mutate = ["src/evalwire/"]
74+
pytest_add_cli_args_test_selection = ["tests/"]
75+
pytest_add_cli_args = ["--ignore=tests/test_evaluators_property.py", "--ignore=tests/integration"]
76+
do_not_mutate = ["*__init__.py", "*cli.py"]
77+
7278
[dependency-groups]
7379
dev = [
7480
"hypothesis>=6.152.1",
7581
"mkdocs>=1.6.1",
7682
"mkdocs-material>=9.0",
7783
"mkdocstrings[python]>=0.25",
84+
"mutmut>=3.5",
7885
"pre-commit>=4.5.1",
7986
"pytest>=8.0",
8087
"pytest-asyncio>=0.23",

0 commit comments

Comments
 (0)