diff options
author | Chris Withers <chris@withers.org> | 2019-05-02 07:54:29 +0100 |
---|---|---|
committer | Chris Withers <chris@withers.org> | 2019-05-02 09:00:35 +0100 |
commit | d52cb782afe31f0e4736d1da2e173e6ff90492b8 (patch) | |
tree | bd770ab3db1f61b96dd40f9ab14e6b23d5f8eb15 /mock/tests | |
parent | dd7c43f9190b7fe5903a57e081b1b49dac0a912e (diff) | |
download | mock-d52cb782afe31f0e4736d1da2e173e6ff90492b8.tar.gz |
note about how to mark uncalled functions used in tests such that coverage ignores them.
Diffstat (limited to 'mock/tests')
-rw-r--r-- | mock/tests/testcallable.py | 3 | ||||
-rw-r--r-- | mock/tests/testhelpers.py | 9 |
2 files changed, 4 insertions, 8 deletions
diff --git a/mock/tests/testcallable.py b/mock/tests/testcallable.py index 30e1f26..729947e 100644 --- a/mock/tests/testcallable.py +++ b/mock/tests/testcallable.py @@ -107,8 +107,7 @@ class TestCallable(unittest.TestCase): pass class OldStyle: - def __call__(self): - pass + def __call__(self): pass class OldStyleSub(OldStyle): pass diff --git a/mock/tests/testhelpers.py b/mock/tests/testhelpers.py index 228c0c6..278fe6b 100644 --- a/mock/tests/testhelpers.py +++ b/mock/tests/testhelpers.py @@ -614,8 +614,7 @@ class SpecSignatureTest(unittest.TestCase): @unittest.skipIf(six.PY3, "No old style classes in Python 3") def test_old_style_classes(self): class Foo: - def f(self, a, b): - pass + def f(self, a, b): pass class Bar(Foo): g = Foo() @@ -797,8 +796,7 @@ class SpecSignatureTest(unittest.TestCase): @unittest.skipIf(six.PY3, 'no old style classes in Python 3') def test_signature_old_style_class(self): class Foo: - def __init__(self, a, b=3): - pass + def __init__(self, a, b=3): pass mock = create_autospec(Foo) @@ -904,8 +902,7 @@ class SpecSignatureTest(unittest.TestCase): def test_autospec_property(self): class Foo(object): @property - def foo(self): - return 3 + def foo(self): pass foo = create_autospec(Foo) mock_property = foo.foo |