Add unit tests for scenario module#1
Open
cstefanache wants to merge 2 commits into
Open
Conversation
Owner
Author
|
Code review comments:\n\n1. Consider adding more edge case tests for validation scenarios\n2. Use parametrized tests where possible to reduce code duplication\n3. The test_load_scenario function uses temporary files; consider mocking file operations instead\n4. Add more detailed docstrings explaining what each test validates\n5. Test empty lists and None values in configurations |
- Use @pytest.mark.parametrize to reduce duplication across dtype, role, label, name, and token-count tests - Replace tempfile usage in test_load_scenario with unittest.mock.patch to avoid real filesystem access - Add detailed docstrings to every test explaining what is validated - Add edge case tests: empty lists, None values, boundary values (top_k_probs=0, max_new_tokens=1), backslash/tab/newline in labels and names - Add tests for ModelConfig defaults, gguf_file=None, device literals, GenerationConfig optional fields, CaptureConfig layers variants, OutputConfig custom dir, Scenario reference_states, and load_scenario error paths (invalid YAML, missing required field) - Grow test count from 8 to 76 passing tests
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.
This PR adds comprehensive unit tests for the scenario module, including validation tests for all Pydantic models and functionality tests for loading scenarios from YAML files.