Repository navigation
Added tests for create_autotest_settings_class - #22
Merged
Merged
Conversation
create_autotest_settings_class is the main entry point for building the settings type but had no tests. Calling it with no tester classes failed with a confusing "reduce() of empty iterable" TypeError; it now raises a ValueError with a clear message. Also narrowed the tester_classes type hint to list[type[BaseTesterSettings]]. 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.
Summary
create_autotest_settings_classis the main entry point for building the top-level settings type, but it had no tests in this repo. Calling it with an empty list of tester classes failed with the confusingTypeError: reduce() of empty iterable with no initial value.ValueError("At least one tester class is required")before building the union, and the docstring mentions this.tester_classestype hint is narrowed fromlist[type]tolist[type[BaseTesterSettings]].tests/test_types/test_core.pycovering: decoding a settings document with two tester classes in the union (each entry is decoded as the class matching itstester_type, and_useris decoded); a single tester class; an emptytesterslist being rejected (min_length=1); an unknowntester_typebeing rejected; and an emptytester_classeslist raisingValueError.Testing
uv sync --locked --all-extras --dev, thenuv run pytest -q: 16 passed.uv run ruff check .: All checks passed.uv run ruff format --check .: 7 files already formatted.ValueErrorguard temporarily removed,test_create_autotest_settings_class_no_tester_classesfailed with thereduce()TypeError; it passes with the guard restored.🤖 Generated with Claude Code