cpython/Lib/unittest
Miss Islington (bot) fa291a35eb
[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 422c4fc855)

Co-authored-by: Robert Collins <robert.collins@cognite.com>
2024-06-11 06:01:02 +00:00
..
__init__.py Revert "bpo-45162: Revert "Remove many old deprecated unittest features"" (GH-92556) 2022-06-26 10:18:06 +03:00
__main__.py
_log.py bpo-41943: Fix bug where assertLogs doesn't correctly filter messages… (GH-22565) 2020-11-02 11:25:29 -08:00
async_case.py gh-97837: Change deprecation warning message in unittest (#97838) 2022-10-04 17:29:18 -07:00
case.py [3.12] gh-113267: Revert "gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588)" (GH-114470) (GH-114994) 2024-02-04 16:00:56 +00:00
loader.py [3.12] gh-59215: unittest: restore _top_level_dir at end of discovery (GH-15242) (GH-117508) 2024-04-23 12:41:32 +00:00
main.py [3.12] GH-113661: unittest runner: Don't exit 5 if tests were skipped (GH-113856) (#113875) 2024-01-09 13:34:38 -08:00
mock.py [3.12] gh-119600: mock: do not access attributes of original when new_callable is set (GH-119601) (#120335) 2024-06-11 06:01:02 +00:00
result.py [3.12] gh-113267: Revert "gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588)" (GH-114470) (GH-114994) 2024-02-04 16:00:56 +00:00
runner.py [3.12] GH-113661: unittest runner: Don't exit 5 if tests were skipped (GH-113856) (#113875) 2024-01-09 13:34:38 -08:00
signals.py
suite.py bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) 2021-08-30 18:25:59 +02:00
util.py bpo-32360: unittest.util: Use Counter instead of custom count function (GH-4994) 2018-01-24 16:49:58 +09:00