Test coverage: FauxProvider edge cases (abort, no-delta, cache, error) - #57
Merged
Conversation
… paths Cover previously uncovered lines in providers/faux.py: - Lines 147-148: _can_accept_extended_args ValueError/TypeError fallback - Lines 279-290: _produce exception handler for factory errors and BaseException re-raise - Lines 320-325: block-level abort check between content blocks - Lines 340-347: abort during thinking chunk streaming - Lines 425-432: abort during tool call chunk streaming - Cache token calculation: first-call structure, full prefix match, and partial prefix change scenarios Closes #51
Add task exception assertion to BaseException test and refactor three chunk-abort tests to use synchronous push-patching instead of consumer-side signal setting, eliminating timing races.
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
cubepi/providers/faux.pyNew test classes and cases
TestCanAcceptExtendedArgs(lines 147-148)ValueErrorandTypeErrorfallback in_can_accept_extended_argswheninspect.signature()failsTestFauxProviderProduceExceptionHandling(lines 279-290)Exceptionproduces error result without re-raiseBaseExceptionproduces error result and re-raisesTestFauxProviderAbortDuringBlocks(lines 320-325, 340-347, 425-432)MessageStream.pushTestFauxProviderCacheTokenCalculation(cache logic)input_tokens == cache_write_tokens,cache_read == 0cache_read > 0,cache_write == 0,input_tokens == 0cache_read > 0andcache_write > 0Test plan
pytest tests/ -q-- 310 passedruff check cubepi/ tests/-- all checks passedruff format --check cubepi/ tests/-- 48 files already formattedCloses #51