summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unittest/testmock/testhelpers.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.14] gh-135368: Fix mocks on dataclass specs with `instance=True` ↵Miss Islington (bot)2025-06-141-0/+21
| | | | | | | | | | | | | | | (GH-135421) (#135503) gh-135368: Fix mocks on dataclass specs with `instance=True` (GH-135421) * gh-135368: Fix mocks on dataclass specs with `instance=True` * Extend dataclass mock_methods --------- (cherry picked from commit c8319a3fea9ff7f9b49008be3b5d681112bbe7f3) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* `unittest.mock` test and coverage fixup (#130787)Chris Withers2025-03-031-1/+1
| | | | | | | * Mark functions that will never be called with # pragma: no cover * Fix testpatch.PatchTest.test_exit_idempotent .stop() and __exit__ have subtly different code paths, so to really test __exit__ idempotency, we need to call it specifically twice.
* gh-71339: Add additional assertion methods for unittest (GH-128707)Serhiy Storchaka2025-01-141-1/+1
| | | | | | | | | | | | Add the following methods: * assertHasAttr() and assertNotHasAttr() * assertIsSubclass() and assertNotIsSubclass() * assertStartsWith() and assertNotStartsWith() * assertEndsWith() and assertNotEndsWith() Also improve error messages for assertIsInstance() and assertNotIsInstance().
* gh-124176: Add special support for dataclasses to `create_autospec` (#124429)sobolevn2024-09-271-0/+72
|
* gh-65454: avoid triggering call to a PropertyMock in ↵blhsing2024-06-111-0/+8
| | | | NonCallableMock.__setattr__ (#120019)
* gh-102978: Fix mock.patch function signatures for class and staticmethod ↵Tomas R2023-04-131-0/+18
| | | | | | | decorators (#103228) Fixes unittest.mock.patch not enforcing function signatures for methods decorated with @classmethod or @staticmethod when patch is called with autospec=True.
* gh-103329: Add regression test for PropertyMock with side effect (#103358)Russell Keith-Magee2023-04-081-1/+22
|
* gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ (#94043)Victor Stinner2022-06-211-0/+1127
* Move Lib/unittest/test/ to Lib/test/test_unittest/ * Remove Lib/test/test_unittest.py * Replace unittest.test with test.test_unittest * Remove unittest.load_tests() * Rewrite unittest __init__.py and __main__.py * Update build system, CODEOWNERS, and wasm_assets.py