-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
unittest.mock.patch.dict
returns function when applied to coroutines
#98086
Labels
type-bug
An unexpected behavior, bug, or error
Comments
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Oct 8, 2022
cjw296
pushed a commit
that referenced
this issue
Nov 11, 2022
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Nov 11, 2022
…onGH-98095) (cherry picked from commit 67b4d27) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This was referenced Nov 11, 2022
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Nov 11, 2022
…onGH-98095) (cherry picked from commit 67b4d27) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
ethanfurman
pushed a commit
to ethanfurman/cpython
that referenced
this issue
Nov 12, 2022
cjw296
pushed a commit
that referenced
this issue
Nov 19, 2022
tirkarthi
pushed a commit
that referenced
this issue
Nov 20, 2022
Thanks everyone, looks like this has been fixed and backported |
bmwiedemann
pushed a commit
to bmwiedemann/openSUSE
that referenced
this issue
Jun 3, 2023
https://build.opensuse.org/request/show/1090625 by user mcepl + dimstar_suse - Add 99366-patch.dict-can-decorate-async.patch fixing gh#python/cpython#98086 (backport from Python 3.10 patch in gh#python/cpython!99366), fixing bsc#1211158. - Add CVE-2007-4559-filter-tarfile_extractall.patch to fix CVE-2007-4559 (bsc#1203750) by adding the filter for tarfile.extractall (PEP 706).
mcepl
added a commit
to openSUSE-Python/cpython
that referenced
this issue
Apr 3, 2024
Code is from gh#python/cpython@88b101f, it was released upstream in 3.10.9. Fixes: gh#python#98086
mcepl
added a commit
to openSUSE-Python/cpython
that referenced
this issue
Apr 4, 2024
Code is from gh#python/cpython@88b101f, it was released upstream in 3.10.9. Fixes: gh#python#98086 Patch: 99366-patch.dict-can-decorate-async.patch
mcepl
added a commit
to openSUSE-Python/cpython
that referenced
this issue
Apr 4, 2024
Code is from gh#python/cpython@88b101f, it was released upstream in 3.10.9. Fixes: gh#python#98086 Patch: 99366-patch.dict-can-decorate-async.patch
mcepl
added a commit
to openSUSE-Python/cpython
that referenced
this issue
Apr 4, 2024
Code is from gh#python/cpython@88b101f, it was released upstream in 3.10.9. Fixes: gh#python#98086 Patch: 99366-patch.dict-can-decorate-async.patch
mcepl
added a commit
to openSUSE-Python/cpython
that referenced
this issue
Apr 4, 2024
Code is from gh#python/cpython@88b101f, it was released upstream in 3.10.9. Fixes: gh#python#98086 Patch: 99366-patch.dict-can-decorate-async.patch
mcepl
added a commit
to openSUSE-Python/cpython
that referenced
this issue
Apr 4, 2024
Code is from gh#python/cpython@88b101f, it was released upstream in 3.10.9. Fixes: gh#python#98086 Patch: 99366-patch.dict-can-decorate-async.patch
mcepl
added a commit
to openSUSE-Python/cpython
that referenced
this issue
Apr 4, 2024
Code is from gh#python/cpython@88b101f, it was released upstream in 3.10.9. Fixes: gh#python#98086 Patch: 99366-patch.dict-can-decorate-async.patch
mcepl
added a commit
to openSUSE-Python/cpython
that referenced
this issue
Apr 4, 2024
Code is from gh#python/cpython@88b101f, it was released upstream in 3.10.9. Fixes: gh#python#98086 Patch: 99366-patch.dict-can-decorate-async.patch
mcepl
added a commit
to openSUSE-Python/cpython
that referenced
this issue
Apr 4, 2024
Code is from gh#python/cpython@88b101f, it was released upstream in 3.10.9. Fixes: gh#python#98086 Patch: 99366-patch.dict-can-decorate-async.patch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
unittest.mock.patch.dict
returns a synchronous function when applied to coroutines. Contrary to that,unittest.mock.patch
returns coroutines when applied to coroutines (see #81177).My expectation is that
patch
andpatch.dict
behave the same when applied to coroutines. I expect the following code to printTrue
andTrue
, but it printsTrue
andFalse
for CPython>=3.8:Your environment
CPython v3.7 is not affected by this issue, because support for coroutines was added to
mock.patch
in v3.8 (see #81177). The supplied example printsFalse
andFalse
.patch.dict
can decorate async functions (GH-98095) #99365patch.dict
can decorate async functions (GH-98095) #99366The text was updated successfully, but these errors were encountered: