-
-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix test compatibility with urllib3 #636
Merged
Merged
Conversation
This file contains 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
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #636 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 2858 2858
=========================================
Hits 2858 2858
☔ View full report in Codecov by Sentry. |
phanak-sap
added a commit
to phanak-sap/python-pyodata
that referenced
this pull request
May 15, 2023
The entire logic of the test was based on scenario that server returns response of HTTP 204 No Content (which ends with HTTP Header) with some content in HTTP Body, which is breaking the HTTP protocol logic itself. The Responses package generated such weird simulated response, but now, with being compatible with urllib3 2.x, breaking changes were introduced within this transitive dependency. On the requests side, the bump to same urllib3 2.x means test failures with requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(10 bytes read, -10 more expected)', IncompleteRead(10 bytes read, -10 more expected)) More info: getsentry/responses#636 https://urllib3.readthedocs.io/en/latest/v2-migration-guide.html RFC 2616 - HTTP 1.1 - 10.2.5 - 204 No Content https://datatracker.ietf.org/doc/html/rfc2616#section-10.2.5
phanak-sap
added a commit
to phanak-sap/python-pyodata
that referenced
this pull request
May 15, 2023
- remove remove test_function_import_without_return_type_wrong_code The entire logic of the test was based on scenario that server returns response of HTTP 204 No Content (which ends with HTTP Header) with some content in HTTP Body, which is breaking the HTTP protocol logic itself. The Responses package generated such weird simulated response and was parsed with urllib 1.X in previous versions of Requests, but now, with being compatible with urllib3 2.x, breaking changes were introduced within this transitive dependency. On the requests side, the bump to same urllib3 2.x means test failures with error: requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(10 bytes read, -10 more expected)', IncompleteRead(10 bytes read, -10 more expected)) - test_update_entity Same rationale, removed invalid body for expected HTTP 204 simulated response Additional info: getsentry/responses#636 https://urllib3.readthedocs.io/en/latest/v2-migration-guide.html RFC 2616 - HTTP 1.1 - 10.2.5 - 204 No Content https://datatracker.ietf.org/doc/html/rfc2616#section-10.2.5
phanak-sap
added a commit
to phanak-sap/python-pyodata
that referenced
this pull request
May 15, 2023
- remove remove test_function_import_without_return_type_wrong_code The entire logic of the test was based on scenario that server returns response of HTTP 204 No Content (which ends with HTTP Header) with some content in HTTP Body, which is breaking the HTTP protocol logic itself. The Responses package generated such weird simulated response and was parsed with urllib 1.X in previous versions of Requests, but now, with being compatible with urllib3 2.x, breaking changes were introduced within this transitive dependency. On the requests side, the bump to same urllib3 2.x means test failures with error: requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(10 bytes read, -10 more expected)', IncompleteRead(10 bytes read, -10 more expected)) - test_update_entity Same rationale, removed invalid body for expected HTTP 204 simulated response Additional info: getsentry/responses#636 https://urllib3.readthedocs.io/en/latest/v2-migration-guide.html RFC 2616 - HTTP 1.1 - 10.2.5 - 204 No Content https://datatracker.ietf.org/doc/html/rfc2616#section-10.2.5
filak-sap
pushed a commit
to SAP/python-pyodata
that referenced
this pull request
May 17, 2023
- remove remove test_function_import_without_return_type_wrong_code The entire logic of the test was based on scenario that server returns response of HTTP 204 No Content (which ends with HTTP Header) with some content in HTTP Body, which is breaking the HTTP protocol logic itself. The Responses package generated such weird simulated response and was parsed with urllib 1.X in previous versions of Requests, but now, with being compatible with urllib3 2.x, breaking changes were introduced within this transitive dependency. On the requests side, the bump to same urllib3 2.x means test failures with error: requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(10 bytes read, -10 more expected)', IncompleteRead(10 bytes read, -10 more expected)) - test_update_entity Same rationale, removed invalid body for expected HTTP 204 simulated response Additional info: getsentry/responses#636 https://urllib3.readthedocs.io/en/latest/v2-migration-guide.html RFC 2616 - HTTP 1.1 - 10.2.5 - 204 No Content https://datatracker.ietf.org/doc/html/rfc2616#section-10.2.5
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.
closes #635
I thought more about the issue #635. Actually, we are back compatible.
urllib3
now enforces content length validation. Our lib proposes auto calculation of content length. However, if the user wants to provide a header and the header does not match actual content length, then user gets an error.Which is expected from the new
urllib3