Skip to content

Fix test_utils.make_mocked_request behaviour for empty payload#7168

Merged
Dreamsorcerer merged 8 commits intoaio-libs:masterfrom
rahulnht:master
Sep 1, 2024
Merged

Fix test_utils.make_mocked_request behaviour for empty payload#7168
Dreamsorcerer merged 8 commits intoaio-libs:masterfrom
rahulnht:master

Conversation

@rahulnht
Copy link
Copy Markdown
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
Copy Markdown

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 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
@patchback
Copy link
Copy Markdown
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.

@patchback
Copy link
Copy Markdown
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 <[email protected]>
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

5 participants