Respect env PATH when locating mitmdump binary#17
Open
recursiveAF wants to merge 3 commits intomainfrom
Open
Conversation
ONCE mode now replays existing entries AND records new ones on cache miss, instead of failing when encountering instructions not in the cassette. This fixes the bug where the first test passes but subsequent tests fail with "Cache miss in replay mode" even though noot should be recording. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add blank line after imports in cache.py - Remove unused imports in test_cache_modes.py Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously, MitmproxyManager used shutil.which("mitmdump") which only
searched the pytest process's PATH, ignoring the env dict passed to
Flow.spawn(). This caused issues when users set a custom PATH in env
to locate mitmdump in non-standard locations.
Now MitmproxyConfig accepts an env parameter, and MitmproxyManager
extracts the PATH from it (if present) to pass to shutil.which().
Co-Authored-By: Claude Opus 4.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.
Summary
PATHfrom theenvdict passed toFlow.spawn()when locatingmitmdumpenvfield toMitmproxyConfigdataclassProblem
Previously,
shutil.which("mitmdump")used the pytest process's PATH, ignoring theenvparameter passed toFlow.spawn(). This meant users couldn't use a custom PATH to locatemitmdumpin non-standard locations.Solution
Extract the
PATHfrom the user-providedenvdict and pass it toshutil.which(path=...).Test plan
test_mitmproxy_manager.py🤖 Generated with Claude Code