Claude/improve coverage docs issues 01 j vp fxsvt25qc ttteg95d ds#22
Merged
thorwhalen merged 2 commits intomasterfrom Nov 15, 2025
Merged
Conversation
This commit resolves multiple issues with enhanced functionality, better error handling, and comprehensive test coverage. ## Issues Resolved ### #10: BufferReader.__next__() compatibility - Modified __next__() to raise StopIteration when stream stopped and no data - Updated __iter__() to catch StopIteration (prevents RuntimeError in Python 3.7+) - Now fully compatible with Python's iterator protocol - Works with builtin next(reader, default) and for loops ### #15: Custom exception classes - Created stream2py/exceptions.py with exception hierarchy - Implemented Stream2PyError base class and specific exceptions - Updated StreamBuffer to use StreamNotStartedError with helpful messages - Exported exceptions module from main package ### #18: Reader started checks - Documented that checks already exist in StreamBuffer.mk_reader() - Enhanced error messages with custom exceptions - Added comprehensive tests demonstrating correct usage patterns ## Tests Added - test_buffer_reader_stopiteration.py (4 tests for #10) - Test StopIteration raised when stream stopped - Test None returned when no data but running - Test builtin next() with default values - Test for loops terminate correctly - test_reader_without_context.py (5 tests for #18) - Test mk_reader() requires started buffer - Test readers work without context manager - Test context manager ensures cleanup - Test recommended usage patterns ## Documentation - RESOLVED_ISSUES.md - comprehensive summary of resolved issues - Updated ISSUE_COMMENTS.md with resolution details for #9, #10, #13, #15, #18 - Clear documentation of when to use context managers ## Test Results - All 28 tests passing - +9 new tests in this commit - 100% passing rate maintained ## Related Issues - #9: Investigated CI - appears correct, needs clarification - #13: Applies to external keyboardstream2py package - #17, #14: Analyzed, documented for future work
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.
No description provided.