🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Use coverage to filter out mutations - #438

Merged
Otto-AA merged 16 commits into
boxed:mainfrom
loufranco:loufranco/395-use-coverage-to-filter-out-mutations
Sep 13, 2025
Merged

Otto-AA merged 16 commits into
boxed:mainfrom
loufranco:loufranco/395-use-coverage-to-filter-out-mutations

Conversation

@loufranco

Copy link
Copy Markdown
Contributor

Closes #395

  1. Added a config called mutate_only_covered_lines so that the default behavior is NOT to use coverage
  2. I needed to reorder the copy_also and source folder setup to happen before coverage
  3. tests and e2e tests added

This works on my project and in the e2e one.

@Otto-AA Otto-AA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

I skimmed through the diff and it looks good so far, only minor comments. I likely have time to test it out on the weekend.

Comment thread mutmut/__main__.py
Comment thread e2e_projects/mutate_only_covered_lines/pyproject.toml
Comment thread mutmut/file_mutation.py Outdated
I inspected the file generated in mutants and the "Bar" on line 10 is not mutated, but coverage.py reported that it wasn't covered, so the bug is in coverage.py.
Comment thread README.rst Outdated
Comment thread README.rst Outdated
@Otto-AA
Otto-AA merged commit 2acbf1f into boxed:main Sep 13, 2025
5 checks passed
@Otto-AA

Otto-AA commented Sep 13, 2025

Copy link
Copy Markdown
Collaborator

Looks very good. While testing, I've found two bugs, but they were not related to this PR 🙃

I've added some more E2E tests, and a minor performance change (only calling cov.get_data() once for all files).

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-tested statements can be reported as "survived" (🙁) instead of "no tests" (🫥)

2 participants