refactor(tests): Parameterize duplicate tests across test suite#73
Merged
ivyleavedtoadflax merged 8 commits intomainfrom Jan 24, 2026
Merged
refactor(tests): Parameterize duplicate tests across test suite#73ivyleavedtoadflax merged 8 commits intomainfrom
ivyleavedtoadflax merged 8 commits intomainfrom
Conversation
Consolidate test_create_ami_instance_not_found and test_create_ami_multiple_instances_found into a single parameterized test. Both tests were functionally identical - mocking resolve_instance_or_exit to raise typer.Exit(1) and verifying the exit code. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tests Consolidate test_list_snapshots_instance_not_found and test_list_snapshots_multiple_instances_found into a single parameterized test. Both tests were functionally identical - mocking resolve_instance_or_exit to raise typer.Exit(1) and verifying the exit code. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidate test_list_volumes_instance_not_found and test_list_volumes_multiple_instances_found into a single parameterized test. Both tests were functionally identical - mocking resolve_instance_or_exit to raise typer.Exit(1) and verifying the exit code. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidate test_should_show_logo_with_help_flag and test_should_show_logo_with_h_flag into a single parameterized test. Both tests were identical except for the flag used (--help vs -h). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…t_ecs.py Consolidate test_scale_command_invalid_count_zero and test_scale_command_invalid_count_negative into a single parameterized test. Both tests were identical except for the count value (0 vs -1). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidate test_add_interactive_invalid_selection_too_high and test_add_interactive_invalid_selection_zero into a single parameterized test. Both tests were identical except for the invalid input (5 vs 0). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidate 5 nearly identical pricing API validation tests into a single parameterized test. Tests for location, operatingSystem, tenancy, preInstalledSw, and capacitystatus filters all shared ~30 lines of duplicate code. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidate flag tests for long/short flag variants into parameterized tests: - --all/-a flag for including terminated instances - --no-strict-host-key/-S flag for disabling strict host key checking - --cost/-c flag for showing cost columns Each pair of tests was identical except for the flag used. 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
Test plan
uv run pytestto verify all tests pass