Repository navigation
v0.5.0 — Respect pytest's python_files config for test exclusion
·
20 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
What's Changed
Bug Fix: Test file exclusion now respects python_files config
Previously, pytest-leela used hardcoded patterns (test_*.py, *_test.py) to exclude test files from mutation targets. This broke projects that use custom test file naming conventions, such as describe_*.py (common with pytest-describe).
Changes in this release:
- Test file exclusion now reads
python_filesfrompytest.ini/pyproject.toml/setup.cfginstead of relying on hardcoded patterns - Custom test file patterns (e.g.,
describe_*.py) are now correctly excluded from mutation targets when using--diffmode conftest.pyis always excluded from mutation targets, regardless of configuration- Pattern matching uses
fnmatchfor consistency with pytest's own behavior
Affected users: Anyone using --diff mode with a non-default python_files setting in their pytest config. Previously, files matching custom patterns would be included as mutation targets, which would generate false negatives (mutations in test infrastructure that don't kill any mutants).
No changes are required to your pytest config or test suite — pytest-leela now reads your existing config automatically.
Commits
e730babFix --diff mode: exclude test files from mutation targets36a6f68Refactor test-file exclusion to use python_files config via fnmatch patterns0c84183Fix perfection game feedback: remove dead assertion, nest test block