cpython/Lib/unittest
Miss Islington (bot) aba5f2a4d1
[3.13] gh-119600: mock: do not access attributes of original when new_callable is set (GH-119601) (#120334)
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 422c4fc855)

Co-authored-by: Robert Collins <robert.collins@cognite.com>
2024-06-11 06:04:06 +00:00
..
__init__.py
__main__.py
_log.py
async_case.py
case.py GH-70647: Deprecate strptime day of month parsing without a year present to avoid leap-year bugs (GH-117107) 2024-04-03 14:19:49 +02:00
loader.py gh-59215: unittest: restore _top_level_dir at end of discovery (GH-15242) 2024-04-03 16:17:13 +02:00
main.py
mock.py [3.13] gh-119600: mock: do not access attributes of original when new_callable is set (GH-119601) (#120334) 2024-06-11 06:04:06 +00:00
result.py
runner.py
signals.py
suite.py
util.py