-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
ChoreMiscellaneous chores to maintain the projectMiscellaneous chores to maintain the projectPython LangChanges to Python source codeChanges to Python source codeTestingSomething can be verifiedSomething can be verifiedgood first issueGood for newcomersGood for newcomers
Milestone
Description
Problem
The get_default_ip() function is currently duplicated in multiple test files:
tests/test_hear_cleanup.py(lines 176-200)tests/test_hear_server.py
This violates DRY principles and creates maintenance overhead.
Proposed Solution
Refactor the get_default_ip() function into a common location, with suggested targets:
tests.contextmodule - Most appropriate for test utility functionsmulticast.sktmodule - Alternative location if it fits better with socket utilities
Implementation Notes
- Remove duplicate implementations from individual test files
- Import the centralized function where needed
- Ensure consistent behavior across all usage points
- Update any related documentation
Context
This refactoring was identified during code review in PR #448. The function implements RFC 5737 compliant IP detection using TEST-NET-3 (203.0.113.1) and is well-designed but should not be duplicated.
References
- Original discussion: Patch test coverage chore 441 #448 (comment)
- PR: Patch test coverage chore 441 #448
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ChoreMiscellaneous chores to maintain the projectMiscellaneous chores to maintain the projectPython LangChanges to Python source codeChanges to Python source codeTestingSomething can be verifiedSomething can be verifiedgood first issueGood for newcomersGood for newcomers
Type
Projects
Status
To do