summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorRobert Collins <robert.collins@cognite.com>2024-06-11 05:41:12 (GMT)
committerGitHub <noreply@github.com>2024-06-11 05:41:12 (GMT)
commit422c4fc855afd18bcc6415902ea1d85a50cb7ce1 (patch)
tree78d95472f838196f72aa5d58c97bdfc188a67db1 /Python
parent6efe3460693c4f39de198a64cebeeee8b1d4e8b6 (diff)
downloadcpython-422c4fc855afd18bcc6415902ea1d85a50cb7ce1.zip
cpython-422c4fc855afd18bcc6415902ea1d85a50cb7ce1.tar.gz
cpython-422c4fc855afd18bcc6415902ea1d85a50cb7ce1.tar.bz2
gh-119600: mock: do not access attributes of original when new_callable is set (#119601)
In order to patch flask.g e.g. as in #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.
Diffstat (limited to 'Python')
0 files changed, 0 insertions, 0 deletions