summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-11 06:01:02 (GMT)
committerGitHub <noreply@github.com>2024-06-11 06:01:02 (GMT)
commitfa291a35eb29c53958aa5d2e2b58aea2441ffca8 (patch)
tree3847b5b8058335533d3d0943317b90835c3df2c7 /Python
parenta9f2daf1ab182d95b44ee94dc9fb8faec60e34b1 (diff)
downloadcpython-fa291a35eb29c53958aa5d2e2b58aea2441ffca8.zip
cpython-fa291a35eb29c53958aa5d2e2b58aea2441ffca8.tar.gz
cpython-fa291a35eb29c53958aa5d2e2b58aea2441ffca8.tar.bz2
[3.12] gh-119600: mock: do not access attributes of original when new_callable is set (GH-119601) (#120335)
gh-119600: mock: do not access attributes of original when new_callable is set (GH-119601) In order to patch flask.g e.g. as in GH-84982, that proxies getattr must not be invoked. For that, mock must not try to read from the original object. In some cases that is unavoidable, e.g. when doing autospec. However, patch("flask.g", new_callable=MagicMock) should be entirely safe. (cherry picked from commit 422c4fc855afd18bcc6415902ea1d85a50cb7ce1) Co-authored-by: Robert Collins <robert.collins@cognite.com>
Diffstat (limited to 'Python')
0 files changed, 0 insertions, 0 deletions