summaryrefslogtreecommitdiff
path: root/Lib/unittest/test/testmock/testmagicmethods.py
Commit message (Collapse)AuthorAgeFilesLines
* Clarify and fix assertions that mocks have not been awaited (GH-18196)Chris Withers2020-01-271-2/+0
| | | | | - 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-271-5/+5
| | | | | | | | * 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-281-3/+0
|
* bpo-38093: Correctly returns AsyncMock for async subclasses. (GH-15947)Lisa Roach2019-09-191-1/+34
|
* Mock 100% coverage (GH-13045)Chris Withers2019-05-011-4/+2
| | | | | | | | | | | 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-251-0/+10
| | | | 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-221-0/+5
| | | unittest.mock.MagicMock now supports the __round__() magic method.
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-1/+1
| | | | | | | | * 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-031-1/+1
|
* Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-1/+0
|
* Issue #23310: Fix MagicMock's initializer to work with __methods__.Łukasz Langa2015-04-131-0/+15
| | | | Behavior equivalent to m.configure_mock(). Patch by Kasia Jachim.
* Issue #23568: Add rdivmod support to MagicMock() objects.Berker Peksag2015-03-151-0/+15
|\ | | | | | | Patch by Håkan Lövdahl.
| * Issue #23568: Add rdivmod support to MagicMock() objects.Berker Peksag2015-03-151-0/+15
| | | | | | | | Patch by Håkan Lövdahl.
* | Issue #23581: Add matmul support to MagicMock.Berker Peksag2015-03-121-0/+11
|/ | | | Patch by Håkan Lövdahl.
* Issue 20968. unittest.mock.MagicMock now supports divisionMichael Foord2014-04-141-0/+25
|
* Issue #19594: Use specific asserts in unittest tests.Serhiy Storchaka2013-11-171-4/+4
|
* Fix exception when calling reset_mock on a mock created with autospecMichael Foord2012-06-091-0/+8
|
* unittest.mock.MagicMock objects are now unorderable by defaultMichael Foord2012-03-251-0/+13
|
* PEP 417: Adding unittest.mockMichael Foord2012-03-141-0/+382