Repository navigation
tests: compare the error reply of server.py as JSON - #970
Merged
Merged
Conversation
* test_server_continues_after_client_exception now parses the PIME_MSG reply instead of matching a fixed string. server.py builds the error reply with json.dumps() since f7fed0a, which emits {"success": false} with a space, so the exact-string assertion has been failing on master even though the behaviour is correct. The test now checks the decoded JSON, so the formatting of the reply no longer matters. Generated with assistance from Claude Code (Claude Fable 5.1). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
|
thanks! |
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.
tests/test_backend_resilience.py::test_server_continues_after_client_exceptionhas been failing on master since f7fed0a:server.pynow builds the error reply withjson.dumps(), which emits{"success": false}(with a space), while the test matched the exact string{"success":false}.The behaviour under test is correct, only the assertion was too literal. The test now extracts the
PIME_MSG|client-1|line and compares the decoded JSON, so the reply formatting no longer matters.Verified with the bundled Python 3.12.9:
python3\python.exe -m unittest discover -s tests -p "*test*.py"→ 16 tests OK (was 1 failure).Generated with assistance from Claude Code (Claude Fable 5.1).