Improve test coverage and refactor visitor.rs#539
Merged
MatthewMckee4 merged 2 commits intomainfrom Mar 21, 2026
Merged
Conversation
Refactor `try_process_imported_symbol` in visitor.rs to use `?` via a
helper method returning `Option<()>`, replacing 15 `let ... else { return }`
patterns. Extract `is_generator()` helper to deduplicate generator detection.
Add integration tests covering:
- `--fail-fast` flag (stops after first failure)
- `--fail-fast` across multiple modules
- `--dry-run` with nested packages
- `-s` (show Python output)
- `--retry` flag for flaky tests
- `--output-format=concise` with failures and discovery errors
- `--durations` with skipped tests
- `--last-failed` with multiple files
- `--last-failed` after fixing a failing test
- `@expect_fail` combined with `@parametrize`
Merging this PR will not alter performance
|
Use `tempfile.gettempdir()` instead of hardcoded `/tmp` which doesn't exist on Windows.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
try_process_imported_symbolinvisitor.rsto use?viaresolve_imported_fixture(), replacing 15let ... else { return }patternsis_generator()helper to deduplicate generator detection logicRefactoring
try_process_imported_symbolnow delegates toresolve_imported_fixture() -> Option<()>which uses?for all fallible stepsis_generator()extracted as a standalone function, used by bothprocess_fixture_functionandresolve_imported_fixtureNew tests
--fail-faststops after first failure, works across modules--dry-runwith nested package structure-s(show Python output) flag--retryflag for flaky tests--output-format=concisewith test failures and discovery errors--durationswith skipped tests (verifies skipped tests appear in durations)--last-failedwith multiple files and after fixing a test@expect_failcombined with@parametrize(both pytest and karva)Test plan
just test— all 716 tests passuvx prek run -a— all checks pass🤖 Generated with Claude Code