Refactor pytest fixtures using factory pattern to reduce duplication#24
Merged
nehalkpatel merged 1 commit intomainfrom Nov 26, 2025
Merged
Refactor pytest fixtures using factory pattern to reduce duplication#24nehalkpatel merged 1 commit intomainfrom
nehalkpatel merged 1 commit intomainfrom
Conversation
Replace three nearly identical application fixtures (blinky, uart_echo, i2c_demo) with a single fixture factory function. This reduces code duplication and improves maintainability. Changes: - Add `_application_fixture_factory()` helper function that generates pytest fixtures with common lifecycle management - Replace 98 lines of duplicated fixture code with 47-line factory - Maintain identical behavior and test compatibility - All 11 integration tests pass (100% pass rate) Benefits: - DRY: Single source of truth for application lifecycle - Maintainability: Bug fixes only need to be made once - Consistency: All fixtures behave identically - 27% reduction in conftest.py size (160 → 117 lines) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <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.
Replace three nearly identical application fixtures (blinky, uart_echo, i2c_demo) with a single fixture factory function. This reduces code duplication and improves maintainability.
Changes:
_application_fixture_factory()helper function that generates pytest fixtures with common lifecycle managementBenefits:
🤖 Generated with Claude Code