cpython/Lib/test/test_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
..
testmock [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
__init__.py
__main__.py
_test_warnings.py
dummy.py
support.py
test_assertions.py gh-68968: Correcting message display issue with assertEqual (#103937) 2023-05-04 16:37:17 -06:00
test_async_case.py
test_break.py
test_case.py gh-68968: Correcting message display issue with assertEqual (#103937) 2023-05-04 16:37:17 -06:00
test_discovery.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
test_functiontestcase.py
test_loader.py [3.12] gh-84867: Do not load tests from TestCase and FunctionTestCase (GH-100497) (#109327) 2023-10-02 16:57:44 +02:00
test_program.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
test_result.py
test_runner.py [3.12] gh-106300: Improve errors testing in test_unittest.test_runner (GH-106737) (#108006) 2023-08-16 12:13:35 +02:00
test_setups.py
test_skipping.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
test_suite.py