Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bpo-38669: patch.object now raises a helpful error (GH17034) | Elena Oat | 2019-12-08 | 1 | -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 Kim | 2019-08-30 | 1 | -3/+3 |
| | |||||
* | bpo-32299: Return patched dict when using patch.dict as a context manager ↵ | Mario Corchero | 2019-05-28 | 1 | -0/+7 |
| | | | | | | (GH-11062) | ||||
* | Mock 100% coverage (GH-13045) | Chris Withers | 2019-05-01 | 1 | -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 Withers | 2019-05-01 | 1 | -1/+0 |
| | |||||
* | bpo-23078: Add support for {class,static}method to mock.create_autospec() ↵ | Xtreak | 2019-04-22 | 1 | -0/+20 |
| | | | | | (GH-11613) Co-authored-by: Felipe <felipe.nospam.ochoa@gmail.com> | ||||
* | bpo-36366: Return None on stopping unstarted patch object (GH-12472) | Xtreak | 2019-03-28 | 1 | -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 ↵ | Xtreak | 2019-02-24 | 1 | -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 Bose | 2018-12-07 | 1 | -11/+16 |
| | | | | (GH-8520) | ||||
* | Fixes issue28380: unittest.mock Mock autospec functions now properly support | Gregory P. Smith | 2016-10-06 | 1 | -0/+6 |
| | | | | assert_called, assert_not_called, and assert_called_once. | ||||
* | Issue #23277: Remove unused imports in tests. | Serhiy Storchaka | 2016-04-24 | 1 | -2/+2 |
| | |||||
* | Issue #22138: Fix mock.patch behavior when patching descriptors. Restore | Senthil Kumaran | 2016-01-09 | 1 | -0/+26 |
| | | | | | | original values after patching. Patch contributed by Sean McCully. | ||||
* | Merge | Michael Foord | 2014-04-15 | 1 | -1/+18 |
|\ | |||||
| * | Closes issue 21239. unittest.mock.patch.stopall() did not work ↵ | Michael Foord | 2014-04-15 | 1 | -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 Foord | 2014-04-14 | 1 | -2/+22 |
|/ | | | | patching builtin names. | ||||
* | Issue #19013: add unittest.main() epilogs to unittest.mock's own test modules | Antoine Pitrou | 2013-09-13 | 1 | -1/+0 |
| | |||||
* | Adding patch.stopall method to unittest.mock | Michael Foord | 2012-06-10 | 1 | -0/+18 |
| | |||||
* | unittest.mock: a mock created by patch with a spec as the list argument will ↵ | Michael Foord | 2012-03-25 | 1 | -0/+20 |
| | | | | be callable if __call__ is in the spec | ||||
* | Support subclassing unittest.mock._patch and fix various obscure bugs around ↵ | Michael Foord | 2012-03-25 | 1 | -7/+102 |
| | | | | patcher spec arguments | ||||
* | And another one... mock import fix. | Michael Foord | 2012-03-14 | 1 | -2/+2 |
| | |||||
* | Fix import failure in mock test | Michael Foord | 2012-03-14 | 1 | -1/+1 |
| | |||||
* | PEP 417: Adding unittest.mock | Michael Foord | 2012-03-14 | 1 | -0/+1652 |