SIGN IN SIGN UP

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.
R
Robert Collins committed
422c4fc855afd18bcc6415902ea1d85a50cb7ce1
Parent: 6efe346
Committed by GitHub <noreply@github.com> on 6/11/2024, 5:41:12 AM