diff options
author | Chris Withers <chris@withers.org> | 2019-05-01 22:04:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 22:04:04 (GMT) |
commit | adbf178e49113b2de0042e86a1228560475a65c5 (patch) | |
tree | 871ac21aec993e310f915cf2781909282a7a03e9 /Lib/unittest/test/testmock/support.py | |
parent | b7378d77289c911ca6a0c0afaf513879002df7d5 (diff) | |
download | cpython-adbf178e49113b2de0042e86a1228560475a65c5.zip cpython-adbf178e49113b2de0042e86a1228560475a65c5.tar.gz cpython-adbf178e49113b2de0042e86a1228560475a65c5.tar.bz2 |
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.
Diffstat (limited to 'Lib/unittest/test/testmock/support.py')
-rw-r--r-- | Lib/unittest/test/testmock/support.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/unittest/test/testmock/support.py b/Lib/unittest/test/testmock/support.py index f146be2..49986d6 100644 --- a/Lib/unittest/test/testmock/support.py +++ b/Lib/unittest/test/testmock/support.py @@ -9,8 +9,7 @@ def is_instance(obj, klass): class SomeClass(object): class_attribute = None - def wibble(self): - pass + def wibble(self): pass class X(object): |