aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/unittest/test/testmock/testmagicmethods.py
Commit message (Collapse)AuthorAge
* gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ (#94043)Victor Stinner2022-06-21
| | | | | | | | * 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
* Clarify and fix assertions that mocks have not been awaited (GH-18196)Chris Withers2020-01-27
| | | | | - The gc.collect is needed for other implementations, such as pypy - Using context managers over multiple lines will only catch the warning from the first line in the context! - remove a skip for a test that no longer fails on pypy
* Use relative imports in mock and its tests to help backporting (GH-18197)Chris Withers2020-01-27
| | | | | | | | * asyncio.run only available in 3.8+ * iscoroutinefunction has important bungfixes in 3.8 * IsolatedAsyncioTestCase only available in 3.8+
* bpo-38108: Makes mock objects inherit from Base (GH-16060)Lisa Roach2019-09-28
|
* bpo-38093: Correctly returns AsyncMock for async subclasses. (GH-15947)Lisa Roach2019-09-19
|
* Mock 100% coverage (GH-13045)Chris Withers2019-05-01
| | | | | | | | | | | This was achieved by: * moving many pass statements in tests onto their own lines, so they pass line coverage and can match an easy ignore pattern if branch coverage is added later. * removing code that cannot be reached. * removing long-disabled tests. * removing unused code. * adding tests for uncovered code It turned out that removing `if __name__ == '__main__'` blocks that run unittest.main() at the bottom of test files was surprisingly contentious, so they remain and can be filtered out with an appropriate .coveragerc.
* bpo-35022: unittest.mock.MagicMock now also supports __fspath__ (GH-9960)Max Bélanger2018-10-25
| | | | The MagicMock class supports many magic methods, but not __fspath__. To ease testing with modules such as os.path, this function is now supported by default.
* bpo-33516: Add support for __round__ in MagicMock (GH-6880)John Reese2018-05-22
| | | unittest.mock.MagicMock now supports the __round__() magic method.
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-14
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* Spelling fixes (#2902)Ville Skyttä2017-08-03
|
* Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-24
|
* Issue #23310: Fix MagicMock's initializer to work with __methods__.Łukasz Langa2015-04-13
| | | | Behavior equivalent to m.configure_mock(). Patch by Kasia Jachim.
* Issue #23568: Add rdivmod support to MagicMock() objects.Berker Peksag2015-03-15
|\ | | | | | | Patch by Håkan Lövdahl.
| * Issue #23568: Add rdivmod support to MagicMock() objects.Berker Peksag2015-03-15
| | | | | | | | Patch by Håkan Lövdahl.
* | Issue #23581: Add matmul support to MagicMock.Berker Peksag2015-03-12
|/ | | | Patch by Håkan Lövdahl.
* Issue 20968. unittest.mock.MagicMock now supports divisionMichael Foord2014-04-14
|
* Issue #19594: Use specific asserts in unittest tests.Serhiy Storchaka2013-11-17
|
* Fix exception when calling reset_mock on a mock created with autospecMichael Foord2012-06-09
|
* unittest.mock.MagicMock objects are now unorderable by defaultMichael Foord2012-03-25
|
* PEP 417: Adding unittest.mockMichael Foord2012-03-14