summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/testmock/testsealable.py
diff options
context:
space:
mode:
authorChris Withers <chris@withers.org>2019-05-01 22:04:04 (GMT)
committerGitHub <noreply@github.com>2019-05-01 22:04:04 (GMT)
commitadbf178e49113b2de0042e86a1228560475a65c5 (patch)
tree871ac21aec993e310f915cf2781909282a7a03e9 /Lib/unittest/test/testmock/testsealable.py
parentb7378d77289c911ca6a0c0afaf513879002df7d5 (diff)
downloadcpython-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/testsealable.py')
-rw-r--r--Lib/unittest/test/testmock/testsealable.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/Lib/unittest/test/testmock/testsealable.py b/Lib/unittest/test/testmock/testsealable.py
index 0e72b32..59f5233 100644
--- a/Lib/unittest/test/testmock/testsealable.py
+++ b/Lib/unittest/test/testmock/testsealable.py
@@ -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):