summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/testmock/testpatch.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38669: patch.object now raises a helpful error (GH17034)Elena Oat2019-12-081-0/+4
| | | This means a clearer message is now shown when patch.object is called with two string arguments, rather than a class and a string argument.
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-301-3/+3
|
* bpo-32299: Return patched dict when using patch.dict as a context manager ↵Mario Corchero2019-05-281-0/+7
| | | | | | (GH-11062)
* Mock 100% coverage (GH-13045)Chris Withers2019-05-011-104/+60
| | | | | | | | | | | 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.
* remove jython support from unittest.mock (GH#13033)Chris Withers2019-05-011-1/+0
|
* bpo-23078: Add support for {class,static}method to mock.create_autospec() ↵Xtreak2019-04-221-0/+20
| | | | | (GH-11613) Co-authored-by: Felipe <felipe.nospam.ochoa@gmail.com>
* bpo-36366: Return None on stopping unstarted patch object (GH-12472)Xtreak2019-03-281-2/+10
| | | | | | Return None after calling unittest.mock.patch.object.stop() regardless of whether the object was started. This makes the method idempotent. https://bugs.python.org/issue36366
* bpo-35512: Resolve string target to patch.dict decorator during function ↵Xtreak2019-02-241-0/+17
| | | | | | | | | | | | | | call GH#12000 * Resolve string target to patch.dict during function call * Add NEWS entry * Remove unneeded call * Restore original value for support.target and refactor assertions * Add extra assertion to verify unpatched dict
* bpo-33747: Avoid mutating the global sys.modules dict in unittest.mock tests ↵Anirudha Bose2018-12-071-11/+16
| | | | (GH-8520)
* Fixes issue28380: unittest.mock Mock autospec functions now properly supportGregory P. Smith2016-10-061-0/+6
| | | | assert_called, assert_not_called, and assert_called_once.
* Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-2/+2
|
* Issue #22138: Fix mock.patch behavior when patching descriptors. RestoreSenthil Kumaran2016-01-091-0/+26
| | | | | | original values after patching. Patch contributed by Sean McCully.
* MergeMichael Foord2014-04-151-1/+18
|\
| * Closes issue 21239. unittest.mock.patch.stopall() did not work ↵Michael Foord2014-04-151-1/+18
| | | | | | | | deterministically when the same name was patched multiple times.
* | Closes issue 17660. You no longer need to explicitly pass create=True when ↵Michael Foord2014-04-141-2/+22
|/ | | | patching builtin names.
* Issue #19013: add unittest.main() epilogs to unittest.mock's own test modulesAntoine Pitrou2013-09-131-1/+0
|
* Adding patch.stopall method to unittest.mockMichael Foord2012-06-101-0/+18
|
* unittest.mock: a mock created by patch with a spec as the list argument will ↵Michael Foord2012-03-251-0/+20
| | | | be callable if __call__ is in the spec
* Support subclassing unittest.mock._patch and fix various obscure bugs around ↵Michael Foord2012-03-251-7/+102
| | | | patcher spec arguments
* And another one... mock import fix.Michael Foord2012-03-141-2/+2
|
* Fix import failure in mock testMichael Foord2012-03-141-1/+1
|
* PEP 417: Adding unittest.mockMichael Foord2012-03-141-0/+1652