Skip to content
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_utils.make_mocked_request behaviour for empty payload #7168

Merged
merged 8 commits into from
Sep 1, 2024

Conversation

rahulnht
Copy link
Contributor

What do these changes do?

Fixes #7167

In case of empty payload when initialized, it now assigns the payload as EMPTY_RESPONSE instance of EmptyStreamReader available via aiohttp/streams.py

Are there changes in behavior for the user?

No

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jan 13, 2023
@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.28%. Comparing base (51fade1) to head (73c1485).
Report is 1066 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7168   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files         107      107           
  Lines       34219    34221    +2     
  Branches     4057     4056    -1     
=======================================
+ Hits        33631    33633    +2     
  Misses        415      415           
  Partials      173      173           
Flag Coverage Δ
CI-GHA 98.17% <100.00%> (+<0.01%) ⬆️
OS-Linux 97.83% <100.00%> (+<0.01%) ⬆️
OS-Windows 96.24% <100.00%> (+<0.01%) ⬆️
OS-macOS 97.51% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 97.61% <100.00%> (+<0.01%) ⬆️
Py-3.10.14 97.54% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 97.77% <100.00%> (+<0.01%) ⬆️
Py-3.12.5 97.88% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 97.50% <100.00%> (+<0.01%) ⬆️
Py-3.9.19 97.43% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 97.04% <100.00%> (-0.01%) ⬇️
VM-macos 97.51% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 97.83% <100.00%> (+<0.01%) ⬆️
VM-windows 96.24% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Dreamsorcerer Dreamsorcerer added the backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot label Sep 1, 2024
tests/test_test_utils.py Fixed Show fixed Hide fixed
@Dreamsorcerer Dreamsorcerer removed the bot:chronographer:provided There is a change note present in this PR label Sep 1, 2024
@Dreamsorcerer Dreamsorcerer added the bot:chronographer:skip This PR does not need to include a change note label Sep 1, 2024
@Dreamsorcerer Dreamsorcerer merged commit 8a525d9 into aio-libs:master Sep 1, 2024
35 of 36 checks passed
Copy link
Contributor

patchback bot commented Sep 1, 2024

Backport to 3.10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.10/8a525d98c512e624311b16e9891cac9050cc8b8c/pr-7168

Backported as #8969

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Copy link
Contributor

patchback bot commented Sep 1, 2024

Backport to 3.11: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.11/8a525d98c512e624311b16e9891cac9050cc8b8c/pr-7168

Backported as #8970

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Dreamsorcerer pushed a commit that referenced this pull request Sep 1, 2024
…t` behaviour for empty payload (#8970)

**This is a backport of PR #7168 as merged into master
(8a525d9).**

Co-authored-by: Rahul Nahata <rahul.nahata96@gmail.com>
Dreamsorcerer pushed a commit that referenced this pull request Sep 1, 2024
…t` behaviour for empty payload (#8969)

**This is a backport of PR #7168 as merged into master
(8a525d9).**

Co-authored-by: Rahul Nahata <rahul.nahata96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot bot:chronographer:skip This PR does not need to include a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make_mocked_request() behavior is broken when no payload is specified
4 participants