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.
This commit is contained in:
Chris Withers 2019-05-01 23:04:04 +01:00 committed by GitHub
parent b7378d7728
commit adbf178e49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 263 additions and 317 deletions

View file

@ -3,15 +3,10 @@ from unittest import mock
class SampleObject:
def __init__(self):
self.attr_sample1 = 1
self.attr_sample2 = 1
def method_sample1(self):
pass
def method_sample1(self): pass
def method_sample2(self):
pass
def method_sample2(self): pass
class TestSealable(unittest.TestCase):