Collapse repetitive tests into parametrized tests#2
Merged
Conversation
Owner
kaapstorm
commented
Apr 28, 2026
- test_discover.py: 7 fixture-name-mapping tests → 1
- test_walk.py: 3 directory-exclusion tests → 1
- test_config.py: 3 invalid-pyproject tests → 1
- test_targets.py: 3 file-path tests + 3 dotted-selector tests → 2
- test_cli.py: 4 happy-path CLI tests + 3 stderr-error tests → 2
- test_discover.py: 7 fixture-name-mapping tests → 1 - test_walk.py: 3 directory-exclusion tests → 1 - test_config.py: 3 invalid-pyproject tests → 1 - test_targets.py: 3 file-path tests + 3 dotted-selector tests → 2 - test_cli.py: 4 happy-path CLI tests + 3 stderr-error tests → 2 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
kaapstorm
added a commit
that referenced
this pull request
May 3, 2026
Findings #2, #5, #9, #10, #11, #12, #13, #15, #16 from the codebase review. Single commit because each change is small and they touch overlapping files. * #16 Re-export Plugin, ENTRY_POINT_GROUP, and DiscoveryConfig from testsweet/__init__.py so plugin authors and embedders don't have to import from private modules. * #5/#11/#12 Module docstrings on _resolve, _targets, _walk, _loaders, _classify, _config, _discover, _runner, _catches, _params; doc- strings on test_params, test_params_lazy, catch_exceptions, catch_warnings, run, discover; clarify _build_plan's None/set invariant. * #15 Extract _looks_like_filesystem_path from parse_target so the heuristic has a name. * #2 New scoped_sys_path() context manager in _loaders.py owns the snapshot/restore primitive; __main__ uses it instead of an inline try/finally. * #9 Replace load-bearing asserts (vanish under python -O) with conditional raises in _classify._resolve_dotted, and replace catch_warnings.__exit__ asserts with explicit None checks plus typing.cast for the WarningMessage.message narrowing. * #10 _resolve_include_paths and _build_exclude_set drop glob matches that resolve outside project_root. * #13 _to_string_tuple deduplicates its error message. Co-Authored-By: Claude Opus 4.7 (1M context) <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.