Repository navigation
Conversation
Mutated files add functions (x_foo__mutmut_orig, xǁClsǁmethod__mutmut_1) and mutants_... dicts whose names do not start with an underscore, so tests that walk vars()/dir()/inspect.getmembers() see them as public members. Since 3.8.0 mutates @DataClass methods, this shows up in more codebases. Expose a public predicate for filtering them and document it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #586.
Mutated code adds functions (
x_foo__mutmut_orig,xǁClsǁmethod__mutmut_1) andmutants_...dicts to modules and classes. Their names don't start with_, so tests that walkvars(),dir()orinspect.getmembers()treat them as public members. 3.8.0 started mutating dataclass methods, so this now happens in more codebases, and a failing introspection test in the stats run means no mutants get tested.This PR doesn't rename anything. It gives users a supported way to filter the generated names:
mutmut.is_mutmut_generated_name(name)inmutmut.utils.format_utils, re-exported frommutmut. It matches the same names asis_mutated_method_nameplus themutants_x...__mutmutdicts.length,span,DateRangeetc. are kept. There's also a list of lookalike names that must not match.Not included, see the issue: renaming the generated names (it would change every mutant ID) and the
MutantDictimport that shows up at module level.uv run pytest: 469 passed, 2 skipped.pre-commit runis clean on the changed files.AI disclosure: Claude Code (Anthropic, Claude Opus 5.5) wrote this PR (code, tests, docs and this description) and opened it on my account at my request.
I (@kellyhair) will read and reply to review comments directly.