Commit Graph

5 Commits

Author SHA1 Message Date
Chris Withers adbf178e49
Mock 100% coverage (GH-13045)
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.
2019-05-01 23:04:04 +01:00
Xtreak a875ea58b2 bpo-35512: Resolve string target to patch.dict decorator during function 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
2019-02-24 18:54:49 +00:00
Mario Corchero 20428527a7 Remove unused function in `testmock/support.py` (GH-10975)
The function is never imported and the implementation is actually buggy.
As `warnings.catch_warnings` is not imported here.
2018-12-06 17:05:46 +00:00
Berker Peksag 1e8ee9b380 Issue #23277: Remove unused sys and os imports
Patch by Jon Dufresne.
2016-04-24 07:31:42 +03:00
Michael Foord 345266aa7e PEP 417: Adding unittest.mock 2012-03-14 12:24:34 -07:00