diff options
author | rozza@x103086.gcapmedia.com <rozza@x103086.gcapmedia.com> | 2009-11-20 10:07:23 +0000 |
---|---|---|
committer | rozza@x103086.gcapmedia.com <rozza@x103086.gcapmedia.com> | 2009-11-20 10:07:23 +0000 |
commit | e9f83b2bb467204bb6bbbfa0550b8b9fd19c9c7b (patch) | |
tree | 4f2f968d77903383deaa491a8ce7c47f5ebc0f6d /coverage/parser.py | |
parent | 9ece6fdc33b6bead4e2f0a1e1a6388a2f22fe9a8 (diff) | |
download | python-coveragepy-git-e9f83b2bb467204bb6bbbfa0550b8b9fd19c9c7b.tar.gz |
Ensuring that Class definitions exit counts are correct when you use #pragma: no cover for the class
Diffstat (limited to 'coverage/parser.py')
-rw-r--r-- | coverage/parser.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/coverage/parser.py b/coverage/parser.py index de0e0c7f..01b38af3 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -222,8 +222,10 @@ class CodeParser(object): # Class definitions have one extra exit, so remove one for each: for l in self.classdefs: - exit_counts[l] -= 1 - + # Ensure key is there - #pragma: no cover will mean its not + if l in exit_counts: + exit_counts[l] -= 1 + return exit_counts exit_counts = expensive(exit_counts) |