diff options
-rw-r--r-- | coverage/misc.py | 4 | ||||
-rw-r--r-- | metacov.ini | 1 | ||||
-rw-r--r-- | tests/test_oddball.py | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/coverage/misc.py b/coverage/misc.py index f3763461..9b1894f3 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -129,12 +129,12 @@ def expensive(fn): def _wrapped(self): """Inner function that checks the cache.""" if hasattr(self, attr): - raise Exception("Shouldn't have called %s more than once" % fn.__name__) + raise AssertionError("Shouldn't have called %s more than once" % fn.__name__) setattr(self, attr, True) return fn(self) return _wrapped else: - return fn + return fn # pragma: not covered def bool_or_none(b): diff --git a/metacov.ini b/metacov.ini index c59ad818..8170d6dd 100644 --- a/metacov.ini +++ b/metacov.ini @@ -22,6 +22,7 @@ exclude_lines = partial_branches = pragma: part covered + pragma: if failure if env.TESTING: ignore_errors = true diff --git a/tests/test_oddball.py b/tests/test_oddball.py index 7fc122af..e1099e62 100644 --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -176,10 +176,10 @@ class MemoryLeakTest(CoverageTest): # Running the code 10k times shouldn't grow the ram much more than # running it 10 times. ram_growth = (ram_10k - ram_10) - (ram_10 - ram_0) - if ram_growth > 100000: # pragma: only failure + if ram_growth > 100000: # pragma: if failure fails += 1 - if fails > 8: # pragma: only failure + if fails > 8: # pragma: if failure self.fail("RAM grew by %d" % (ram_growth)) |