gh-67765: Tests for wsgiref to increase coverage, converted patches to PR - #112398
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Before the patch:
After the patch:
|
|
This PR is stale because it has been open for 30 days with no activity. |
# Conflicts: # Lib/test/test_wsgiref.py
assertTrue() was used with the expected value as the message.
|
Thanks @MannarAmuthan for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
Sorry, @MannarAmuthan and @serhiy-storchaka, I could not cleanly backport this to |
|
GH-155622 is a backport of this pull request to the 3.15 branch. |
|
Sorry, @MannarAmuthan and @serhiy-storchaka, I could not cleanly backport this to |
|
GH-155624 is a backport of this pull request to the 3.14 branch. |
|
GH-155625 is a backport of this pull request to the 3.13 branch. |
Cover the InputWrapper and ErrorWrapper methods of wsgiref.validate: read, readline, readlines, __iter__, write, writelines and flush. Each is tested both for the AssertionError raised on an invalid call and for the data passed through on a valid one. Co-authored-by: Alex Shkop <a.v.shkop@gmail.com> (cherry picked from commit e96cf73) * Use ExtraAssertions instead of rewriting the assertions assertStartsWith() and assertEndsWith() are provided by test.support.testcase.ExtraAssertions in 3.13, so the new tests can be kept identical to the 3.14+ version. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Amuthan Mannar <amuthanmannar4@gmail.com> Co-authored-by: Alex Shkop <a.v.shkop@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cover the InputWrapper and ErrorWrapper methods of wsgiref.validate: read, readline, readlines, __iter__, write, writelines and flush. Each is tested both for the AssertionError raised on an invalid call and for the data passed through on a valid one. (cherry picked from commit e96cf73) Co-authored-by: Amuthan Mannar <amuthanmannar4@gmail.com> Co-authored-by: Alex Shkop <a.v.shkop@gmail.com>
The original old patch, which increases test coverage is validated, and it is still relevant.
So I converted the patch to Github PR, as asked in the below issue.
Issue: #67765
Original Patch: https://bugs.python.org/file38321/wsgiref_test_wrappers.patch