Repository navigation
Fix stats collection crash when tests run mutated code in a subprocess - #644
Open
MartinThoma wants to merge 1 commit into
Open
MartinThoma wants to merge 1 commit into
MartinThoma wants to merge 1 commit into
Conversation
A test that runs the package in a subprocess with another working directory passes MUTANT_UNDER_TEST=stats on, so the subprocess's trampolines call record_trampoline_hit, which cannot load the mutmut config there and raises FileNotFoundError. Skip recording in that case; such hits never reach mutmut's stats. Remember the failure so later hits do not reload the config. 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.
Another fix that was necessary for my pypdf <-> mutmut improvement :-)
I typically try negated forms ("config_unavailable"), but "not unavailble" is semantically something different than "is available". If you don't mind about that nitpick and prefer the "config_available", I can adjust the PR :-)
Why I needed this change: pypdf has a few tests that run in a subprocess. A test that runs the package in a subprocess with another working directory passes MUTANT_UNDER_TEST=stats on, so the subprocess's trampolines call record_trampoline_hit, which cannot load the mutmut config there and raises FileNotFoundError. Skip recording in that case; such hits never reach mutmut's stats. Remember the failure so later hits do not reload the config.